TryParseInteger(Value: String; Var Result: Integer): Boolean;
Value. Value converted to 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 contains the 123456 value converted to integer type, and the "B" variable contains the attribute of a successful conversion.
See also: