Board index » delphi » StrToFloat > EConvertError

StrToFloat > EConvertError

Have a app which uses real type numbers, in the main procedure have the
following

try
  StrToFloat(Edit1.Text);
except on EConvertError do begin
  raise; exit; end;
end;

Have runn the app on 5 differant PCs, 4 out of 5 work fine but 1 doesn't. All
PCs running Win95 with either Pentium II or Pentium chips (the one that doesn't
has a Pentium 66).

On the PC that's giving the error:
if Text = '32.04'  or any decimal number then get EConvertError.
if Text = 32 or any integer then no error.

Have run the app using all extended, all double, and finally all real variables
(thought might work with real cause they use the software instead of the
chip?), same result 1 out of 5 throws up error.

Any ideas appreciated
Chris
c8...@aol.com

 

Re:StrToFloat > EConvertError


Chris,
  I am not sure if it was that chip or not, but Intel did have a fluky
Pentium that gave floating point errors. Possibly that is what you are
seeing?

          Good luck!!
-Dave
http://www.erols.com/dparsons
----------------------------------------------------
dpars...@erols.com
-----------------------------------------------------

Quote
C8591 wrote in message <19981210174655.10282.00000...@ng145.aol.com>...
>Have a app which uses real type numbers, in the main procedure have the
>following

>try
>  StrToFloat(Edit1.Text);
>except on EConvertError do begin
>  raise; exit; end;
>end;

>Have runn the app on 5 differant PCs, 4 out of 5 work fine but 1 doesn't.
All
>PCs running Win95 with either Pentium II or Pentium chips (the one that
doesn't
>has a Pentium 66).

>On the PC that's giving the error:
>if Text = '32.04'  or any decimal number then get EConvertError.
>if Text = 32 or any integer then no error.

>Have run the app using all extended, all double, and finally all real
variables
>(thought might work with real cause they use the software instead of the
>chip?), same result 1 out of 5 throws up error.

>Any ideas appreciated
>Chris
>c8...@aol.com

Re:StrToFloat > EConvertError


Try looking in the international-settings of the PC that doesn't work. Look
at the decimal sign.
Compare it to the other pc's.

Freddy Biets
h...@village.uunet.be

Re:StrToFloat > EConvertError


In article <19981210174655.10282.00000...@ng145.aol.com>, c8...@aol.com (C8591)
writes:

Quote
>Have a app which uses real type numbers, in the main procedure have the
>following

>try
>  StrToFloat(Edit1.Text);
>except on EConvertError do begin
>  raise; exit; end;
>end;

>Have runn the app on 5 differant PCs, 4 out of 5 work fine but 1 doesn't. All
>PCs running Win95 with either Pentium II or Pentium chips (the one that
>doesn't
>has a Pentium 66).

>On the PC that's giving the error:
>if Text = '32.04'  or any decimal number then get EConvertError.
>if Text = 32 or any integer then no error.

Nothing to do with the Pentium chip bug.<g>

What is the setting of Decimal Symbol in the Number tab of the Control Panel |
Regional Settings. If this is a comma instead of a full stop then you will get
that error. This setting is copied to Delphi's DecimalSeparator global variable
on application entry and this global variable can be reset within the program.

If you're using the application in an area where either could be used, then set
the global variable to one and wrap the entry in a try / except where the
OnExcept will change the decimal separator character in the entered string if
it is wrong.

Alan Lloyd
alangll...@aol.com

Other Threads