Currency.TryParse

Syntax

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

Parameters

Value - string value that must be converted into the Currency type.

Result - variable, into which the value in case of successful conversion will be placed.

Description

The TryParse method converts a string value into the Currency type with validation. If conversion is successful, the method returns True, and the new value is placed into the variable specified in the Result parameter.

Example

Sub Main;

Var

b: Boolean;

c: Currency;

s: String;

Begin

s := "234";

b := Currency.TryParse(s, c);

End Sub Main;

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

See also:

Currency