mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:29:14 +02:00
* reverted TryStrToInt to the old implementation since after the val fixed the changes are not
needed anymore as pointed out by Bart B
This commit is contained in:
parent
62f1771121
commit
0764158fd1
@ -960,14 +960,12 @@ end;
|
|||||||
function TryStrToInt(const s: string; out i : Longint) : boolean;
|
function TryStrToInt(const s: string; out i : Longint) : boolean;
|
||||||
var
|
var
|
||||||
Error : word;
|
Error : word;
|
||||||
li : Int64;
|
|
||||||
begin
|
begin
|
||||||
Val(s, li, Error);
|
Val(s, i, Error);
|
||||||
TryStrToInt:=(Error=0) and (li<=High(DWord)) and (li>=Low(Longint));
|
TryStrToInt:=(Error=0)
|
||||||
if TryStrToInt then
|
|
||||||
i:=li;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ StrToInt converts the string S to an integer value,
|
{ StrToInt converts the string S to an integer value,
|
||||||
if S does not represent a valid integer value EConvertError is raised }
|
if S does not represent a valid integer value EConvertError is raised }
|
||||||
function StrToInt(const S: string): Longint;
|
function StrToInt(const S: string): Longint;
|
||||||
|
Loading…
Reference in New Issue
Block a user