TryParse(Value: String; Var Result: Decimal): Boolean;
Value - string value that must be converted into the Decimal type.
Result - variable, into which the value in case of successful conversion will be placed.
The TryParse method converts string value into the Decimal type with validation. If conversion is successful, the method returns True, and the new value is placed into the variable specified in the Result input parameter.
Sub Main;
Var
b: Boolean;
d: Decimal;
s: String;
Begin
s := "234";
b := Decimal.TryParse(s, d);
End Sub Main;
After executing the example in case of successful conversion the "b" variable will contain True, and the "d" variable will contain the value 234.
See also: