TryParse(Value: String; Var Result: Integer): Boolean;
Value. String value that must be converted to integer type.
Result. Variable, into which the value in case of successful conversion will be placed.
The TryParse method converts a string value into an integer and checks for the string correctness.
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;
i: Integer;
s: String;
Begin
s := "234";
b := Integer.TryParse(s, i);
End Sub UserProc;
After executing this example if the transformation is completed successfully, the "b" variable contains True, and the "i" variable contains the 234 value.
See also: