Article ID 1388
Article Title HOWTO: Getting the list separator for your Windows locale
Article URL http://www.dataaccess.com/KBasePublic/KBPrint.asp?ArticleID=1388
KBase Category Visual DataFlex
Date Created 05/27/2001
Last Edit Date 08/18/2010


Article Text
QUESTION:
How to get the listseparator - in use by programs like MS-Excel to separate field values in a CSV file - from your Windows locale.

ANSWER:
Use the following code:
Define LOCALE_SLIST For |CI$0000000C   // list item separator

// Character(s) used to separate list items. For example, a comma is used in
// many locales. The maximum number of characters allowed for this string is 4.
Function LocaleListSeparator Returns String
   String sSeparator
   Integer iRetval

   Move (GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SLIST, 0, 0)) To iRetval
   ZeroString iRetval To sSeparator
   Move (GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SLIST, AddressOf (sSeparator), iRetval)) To iRetVal

   Function_Return (Cstring (sSeparator))
End_Function

WARNING:
The listseparator in use by DataFlex and Visual DataFlex for CSV file (readable via the READ command) is always a comma!


Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2020 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.