Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi 2005 Floating Point operations on Vista-64 1

Status
Not open for further replies.

Andy650

Programmer
Jul 31, 2009
4
CA
I have a Delphi 9.0 (2005) application that calls the following simple code (sanitized for ease of explanation)...

Code:
procedure MyProc;
var
  myNumber: Extended; // tried Real here also
  myString: String;
begin
  myString := '9.04';
  myNumber := strToFloat(myString);
  showMessage(floatToStr(myNumber));
end;

Running on XP SP3 all is well as you would expect but on a client's Vista-64 machine, it is raising an exception: '9.04' is not a valid floating point value

Are there known compatability issues with this function (and any others whilst we're at it) and any documented alternatives for this Delphi version?

Many thanks.

 
I suspect that the regional settings different on the vista machine (having ',' as decimalseparator).

the fix should be easy:

set decimalseparator value to '.' at application initialization.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
[Slaps forehead]. As soon as I heard Vista-64 I started to overthink it with paranoia about flop issues. I'll try it on the client site next week but you gotta be right!

Like the old saying goes. If you hear hoofbeats - think horses not zebras.

Cheers fella!
(Smiles ruefully and packs up for the day to hit the pub.)
 
Andy - Welcome to the forum! It's customary to click on the "Thank whosrdaddy for this valuable post!" link to show your appreciation.

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top