TryParse(Value: String; Var Result: Double): Boolean;
Value. The string value that must be converted to real type.
Result. The variable, to which the value in case of successful conversion will be placed.
The TryParse method converts a string value into the Double 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 UserProc;
Var
B: Boolean;
D: Double;
S: String;
Begin
S := "234.234";
B := Double.TryParse(S, D);
End Sub UserProc;
After executing the example, if the "B" variable contains True, the conversion is successful, and the "D" variable contains the 234.234 value.
See also: