mirror of https://gitlab.com/basile.b/dexed.git
add string helper to convert to int
This commit is contained in:
parent
be6ea9d712
commit
9c50cfa789
|
@ -80,6 +80,8 @@ type
|
||||||
function dirExists: boolean;
|
function dirExists: boolean;
|
||||||
function upperCase: string;
|
function upperCase: string;
|
||||||
function length: integer;
|
function length: integer;
|
||||||
|
function toIntNoExcept(default: integer = -1): integer;
|
||||||
|
function toInt: integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(**
|
(**
|
||||||
|
@ -430,6 +432,16 @@ begin
|
||||||
exit(system.length(self));
|
exit(system.length(self));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TStringHelper.toInt: integer;
|
||||||
|
begin
|
||||||
|
exit(strToInt(self));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TStringHelper.toIntNoExcept(default: integer = -1): integer;
|
||||||
|
begin
|
||||||
|
exit(StrToIntDef(self, default));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TProcessEx.Assign(aValue: TPersistent);
|
procedure TProcessEx.Assign(aValue: TPersistent);
|
||||||
var
|
var
|
||||||
src: TProcess;
|
src: TProcess;
|
||||||
|
|
Loading…
Reference in New Issue