1

Hi I have been coding and so far, there was no problem developing and compiling in Delphi 2007 in WinXP until Delphi XE7 in Win7.

I am not sure why it happened.

The line that the errors pointed to

....
if(tS<>'') then
begin
  Result:=StrToFloat(StringReplace(String(tS),'.',DecimalSeparator,[]));
  Invalid:=False;
end;
....

Errors:

1) [dcc32 Error] UtilNumString.pas(321): E2003 Undeclared identifier:     'DecimalSeparator'
2) [dcc32 Error] UtilNumString.pas(321): E2250 There is no overloaded version     of 'StringReplace' that can be called with these arguments   

Please kin addvise. Thanks

user1739825
  • 820
  • 4
  • 10
  • 27

1 Answers1

5

The old global variables for format settings have been removed. You can either use the FormatSettings global variable :

Result:=StrToFloat(StringReplace(String(tS),'.',FormatSettings.DecimalSeparator,[]));

Or, alternatively (ideally...), you can create a local TFormatSettings and use that instead.

var
  fs : TFormatSettings;
begin
   fs := TFormatSettings.Create();
   Result:=StrToFloat(StringReplace(String(tS),'.',fs.DecimalSeparator,[]));
end;
J...
  • 30,968
  • 6
  • 66
  • 143