Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

ReadDouble fail with a double with more than 14 characters

I have an inifile  "MyInifile.ini" with these values

;Automatically generated file. DO NOT MODIFY!!!

[MainKey]
Var1=0.0021046446945
Var2=0.0022946446945

When I load this inifile with ythis code

  IC.Path:=MyInifile.ini';  //IC is a TElInifile with the default values of the component
  If Not IC.Load Then
    ShowMessage('IC load fail');
  If Not IC.ReadDouble('MainKey','Var1',0,x1) Then
    ShowMessage('Loading Var1 fail')
  Else
    ShowMessage(FloatToStr(x1));
  If Not IC.ReadDouble('MainKey','Var2',0,x2) Then
    ShowMessage('Loading Var2 fail')
  Else
    ShowMessage(FloatToStr(x2));

I get in this configuration the two reading process wrong. If I suppress the last two digits (45) of the doubles, the process is right and if I suppress only the las digit (5), the first is right and the second is wrong.

The reading process fail also with for example this value 9.9E-14. Sure the 14 digits is the main problem.

How can I modify the source of the component to get a right reading process.

Thank you for your help.

Gerard Esposito

Comments

Sign In or Register to comment.