ICultureInfo.TryParseInteger

Syntax

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

Parameters

Value. Value converted into 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 will contain the value "123456" converted into integer type, and the "B" variable will contain the attribute of a successful conversion.

See also:

ICultureInfo