diff --git a/src/ce_common.pas b/src/ce_common.pas index fe0995c6..51f5463c 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -80,6 +80,8 @@ type function dirExists: boolean; function upperCase: string; function length: integer; + function toIntNoExcept(default: integer = -1): integer; + function toInt: integer; end; (** @@ -430,6 +432,16 @@ begin exit(system.length(self)); 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); var src: TProcess;