Beware that in Europe they quite often use "," where we use "." and use "." where we use ",". So if this is the case, the real part should be formatted in the file as "287,472" instead of "287.472"
You can easily test by changing your regional settings to this and running your program. Myles. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 2 October 2003 10:17 To: Multiple recipients of list delphi Subject: [DUG]: Spanish Problem Hi, I got a simple piece of code that reads an text file with three floating point values separated by tabs (no extra hidden characters) The first line looks like -180 -74 287.472 The line Depth := trunc(StrToFloat(extractword(3,txtline,[' ',#9]))); causes an exception when run on a Spanish version of Windows. Fine with English. (Sorry dont have actual exception message available and we dont have a Spanish OS here) The above function extracts 287.472 which ends up as 287 in Depth Any ideas why this may fail on a Spanish OS. If someone has a Spanish OS and can run a test for me can they please contact me at [EMAIL PROTECTED] Cheers PS ExtractWord comes from JVCs jvStrUtils unit function ExtractWord(N: Integer; const S: string; const WordDelims: TCharSet): string; var I: Integer; Len: Integer; begin Len := 0; I := WordPosition(N, S, WordDelims); if I <> 0 then { find the end of the current word } while (I <= Length(S)) and not(S[I] in WordDelims) do begin { add the I'th character to result } Inc(Len); SetLength(Result, Len); Result[Len] := S[I]; Inc(I); end; SetLength(Result, Len); end; --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/