System.ConvUtils.TConvTypeFactor.Create

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor Create(const AConvFamily: TConvFamily; const ADescription: string;  const AFactor: Double);

C++

__fastcall TConvTypeFactor(const TConvFamily AConvFamily, const System::UnicodeString ADescription, const double AFactor);

Properties

Type Visibility Source Unit Parent
constructor public
System.ConvUtils.pas
System.ConvUtils.hpp
System.ConvUtils TConvTypeFactor

Description

Creates an instance of TConvTypeFactor.

Call Create to instantiate a TConvTypeFactor descendant at runtime. This descendant can then be passed to the RegisterConversionType function in order to register a new conversion type. There is no need to instantiate TConvTypeFactor instances directly, because the RegisterConversionType function creates a new TConvTypeFactor instance when you register a conversion type by specifying a conversion factor.

Create assigns the AFactor parameter to the Factor property, the AConvFamily parameter to the ConvFamily property, and the ADescription parameter to the Description property.

If AFactor is zero, Create raises an EZeroDivide exception. If AConvFamily is not the identifier of a registered conversion family, Create raises an EConversionError exception.

See Also