Catch EInvalidOp exceptions from calls to Trunc(), caused by unsigned Int64 values in string parameters of MakeInt().

This commit is contained in:
Ansgar Becker
2012-05-20 12:25:44 +00:00
parent aaf80e7d93
commit 548eb4003f

View File

@ -466,7 +466,12 @@ end;
function MakeInt(Str: String): Int64;
begin
// Result has to be of integer type
try
Result := Trunc(MakeFloat(Str));
except
on E:EInvalidOp do
Result := 0;
end;
end;