System.ConvUtils.TryStrToConvUnit

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function TryStrToConvUnit(AText: string; out AValue: Double; out AType: TConvType): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall TryStrToConvUnit(System::UnicodeString AText, /* out */ double &AValue, /* out */ TConvType &AType);

Properties

Type Visibility Source Unit Parent
function public
System.ConvUtils.pas
System.ConvUtils.hpp
System.ConvUtils System.ConvUtils

Description

Parses a string into a value and conversion type.

Call TryStrToConvUnit to reverse the conversion performed by the ConvUnitToStr function.

AText is the string to parse. It should represent a numeric value followed by the name of a conversion type. For example, '2.5 hours'.

AValue returns the number of units (the numeric value in the string).

AType returns the identifier for the conversion type (unit of measurement).

TryStrToConvUnit returns true if AText can be converted, false otherwise.

See Also