Your program is probably failing when you call StrToFloat?  I suggest you
check the decimal separator in the regional settings in the computer.  I
think if you set your locale to Spanish, this changes the decimal separator
to ',' and the thousand separator to '.' (its a euro thing).  To fix this
simply change the "DateSeparator" variable in your code to always use '.'


Hope this helps!

_______________________
Allan D. Vergara
Software Engineer
Niche Software Ltd
http://www.WorkPace.com



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of [EMAIL PROTECTED]
Sent: Thursday, 2 October 2003 10:17 AM
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/

Reply via email to