Decimal.TryParse

Syntax

TryParse(Value: String; Var Result: Decimal): Boolean;

Parameters

Value. The string value that must be converted to the Decimal type.

Result. The variable, to which the value in case of successful conversion will be placed.

Description

The TryParse method converts string value into the Decimal type with validation.

Comments

If conversion is successful, the method returns True, and the new value is placed into the variable specified in the Result input parameter.

Example

Sub UserProc;
Var
    b: Boolean;
    d: Decimal;
    s: String;
Begin
    s := "234";
    b := Decimal.TryParse(s, d);
End Sub UserProc;

After executing the example in case of successful conversion the "b" variable contains True, and the "d" variable contains the value 234.

See also:

Decimal