mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-09 07:27:46 +02:00
* Added overload for TryStroInt and integer with settings, fix issue #39237
This commit is contained in:
parent
ad8c36e807
commit
2f73633813
@ -290,6 +290,7 @@ Function SwapEndian(W : Word) : Word;
|
||||
Function SwapEndian(C : Cardinal) : Cardinal;
|
||||
function IntToStr(const Value: Integer): string;
|
||||
Function TryStrToInt(const S : String; Out res : Integer) : Boolean;
|
||||
Function TryStrToInt(const S : String; Out res : Integer; Const aSettings : TFormatSettings) : Boolean;
|
||||
Function TryStrToInt(const S : String; Out res : NativeInt) : Boolean;
|
||||
function TryStrToInt(const S: String; out res: NativeInt; Const aSettings : TFormatSettings): Boolean;
|
||||
Function StrToIntDef(const S : String; Const aDef : Integer) : Integer;
|
||||
@ -4794,6 +4795,21 @@ begin
|
||||
Result:=IntTryStrToInt(S,res,aSettings.DecimalSeparator);
|
||||
end;
|
||||
|
||||
function TryStrToInt(const S: String; out res: Integer; Const aSettings : TFormatSettings): Boolean;
|
||||
|
||||
Var
|
||||
N : NativeInt;
|
||||
|
||||
begin
|
||||
Result:=IntTryStrToInt(S,N,aSettings.DecimalSeparator);
|
||||
if Result then
|
||||
if (N<=MaxLongint) then
|
||||
Res:=N
|
||||
else
|
||||
Result:=False;
|
||||
end;
|
||||
|
||||
|
||||
function StrToIntDef(const S: String; const aDef: Integer): Integer;
|
||||
|
||||
Var
|
||||
|
Loading…
Reference in New Issue
Block a user