TryParseInteger(Value: String; Var Result: Integer): Boolean;
Value. Value converted into integer type.
Result. Variable containing result in case of successful conversion.
The TryParseInteger method checks if the specified value can be converted into integer type according to regional standard settings.
If conversion is possible, the Result variable will contain the conversion result and the method returns True, otherwise False.
Sub UserProc;
Var
CI: ICultureInfo;
I: Integer;
B: Boolean;
Begin
CI := CultureInfo.Current;
B := CI.TryParseInteger("12345", I);
End Sub UserProc;
After executing the example the "I" variable will contain the value "123456" converted into integer type, and the "B" variable will contain the attribute of a successful conversion.
See also: