ICultureInfo.TryParseInteger

Syntax

TryParseInteger(Value: String; Var Result: Integer): Boolean;

Parameters

Value. Value converted to integer type.

Result. Variable containing result in case of successful conversion.

Description

The TryParseInteger method checks if the specified value can be converted into integer type according to regional standard settings.

Comments

If conversion is possible, the Result variable will contain the conversion result and the method returns True, otherwise False.

Example

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:

ICultureInfo