Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gerer les séparateurs de décimale
Message
 
To
19/08/1998 18:53:47
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00128317
Message ID:
00128415
Views:
20
>J'aimerai savoir comment faire pour que mon programme visual basic soit capable de déterminer si la configuration du système prend des . ou des , comme séparateurs de décimales.

Essai ce petit bout de code. En prime je t'offre le format de la date ainsi que le séparateur de la date.

Private Declare Function GetProfileString Lib "kernel32" Alias "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long

Public Sub ChargerInfoReg()
Dim lngReturn As Long
Dim strDate As String
Dim strSepDate As String
Dim strSdecimal As String

strDate = String$(20, 0)
lngReturn = GetProfileString("INTL", "sShortDate", "DD/MM/YYYY", strDate, Len(strDate))
strDate = Left$(strDate, lngReturn)

strSepDate = String$(20, 0)
lngReturn = GetProfileString("INTL", "sDate", "/", strSepDate, Len(strSepDate))
strSepDate = Left$(strSepDate, lngReturn)

strSdecimal = String$(20, 0)
lngReturn = GetProfileString("INTL", "sDecimal", ".", strSdecimal, Len(strSdecimal))
strSDecimal = Left$(strSdecimal, lngReturn)
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform