Skip to content

Commit baec9a3

Browse files
committed
[commons] news functions
1 parent 064b66c commit baec9a3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Quick.Commons.pas

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ EShellError = class(Exception);
366366
function RemoveLastChar(const aText : string) : string;
367367
function DateTimeToSQL(aDateTime : TDateTime) : string;
368368
function IsInteger(const aValue : string) : Boolean;
369+
function IsFloat(const aValue : string) : Boolean;
370+
function IsBoolean(const aValue : string) : Boolean;
369371
//extract a substring and deletes from source string
370372
function ExtractStr(var vSource : string; aIndex : Integer; aCount : Integer) : string;
371373
//get first string between string delimiters
@@ -1826,6 +1828,20 @@ function IsInteger(const aValue : string) : Boolean;
18261828
Result := TryStrToInt(aValue,i);
18271829
end;
18281830

1831+
function IsFloat(const aValue : string) : Boolean;
1832+
var
1833+
e : Extended;
1834+
begin
1835+
Result := TryStrToFloat(aValue,e);
1836+
end;
1837+
1838+
function IsBoolean(const aValue : string) : Boolean;
1839+
var
1840+
b : Boolean;
1841+
begin
1842+
Result := TryStrToBool(aValue,b);
1843+
end;
1844+
18291845
function ExtractStr(var vSource : string; aIndex : Integer; aCount : Integer) : string;
18301846
begin
18311847
if aIndex > vSource.Length then Exit('');

0 commit comments

Comments
 (0)