Currency.TryParse

Syntax

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

Parameters

Value. The string value that should be converted to the Currency type.

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

Description

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

Comments

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

Example

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

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

See also:

Currency