System.ConvUtils.StrToConvUnit

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function StrToConvUnit(AText: string; out AType: TConvType): Double;

C++

extern DELPHI_PACKAGE double __fastcall StrToConvUnit(System::UnicodeString AText, /* 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 StrToConvUnit 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'.

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

StrToConvUnit returns the number of units (the numeric portion of the string).

If AText can't be parsed into a value and conversion type, StrToConvUnit raises an EConversionError exception.

See Also