FMX.Text.TryTextToValue
Delphi
function TryTextToValue(AText: string; var AValue: Single; DefaultValue: Single): boolean;
function TryTextToValue(AText: string; var AValue: Double; DefaultValue: Double): boolean;
C++
extern DELPHI_PACKAGE bool __fastcall TryTextToValue(System::UnicodeString AText, float &AValue, float DefaultValue)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | FMX.Text.pas FMX.Text.hpp |
FMX.Text | FMX.Text |
Description
Converts the text to a numeric value and returns if the operation was successful.
TryTextToValue returns True if the conversion succeeds and False otherwise.
The result of the conversion is stored in the AValue parameter. If the conversion is not successful, DefaultValue is assigned to AValue.