If you're creating a CSV by manually writing to text files, don't  
hardcode the comma. Use GetLocaleFormatSettings to read the locale  
list separator.

var
   ListSeparator: string;
   FormatSettings: TFormatSettings;
begin
   GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FormatSettings);
   ListSeparator := string(FormatSettings.ListSeparator);
end;

List Separator is part of your locale settings (in XP, Control Panel  
 >> Regional and Language Options >> Region Options tab >> Customise  
 >> Numbers tab >> List Separator). Database engines and Excel use  
this when parsing CSVs.

Many countries which use a comma for a decimal point use a semicolon  
for the list separator, and it can even be up to four chars long. I  
recently discovered the consequences of hardcoding a comma myself!

Robin

On 30 Apr 2005, at 23:42, Katja Bergman wrote:
> For writing to textfiles, you can use the procedures
> AssignFile/Rewrite/Write/WriteLn/CloseFile to write the fields to a
> textfile.


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to