System.Classes.RegisterIntegerConsts

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure RegisterIntegerConsts(AIntegerType: Pointer; AIdentToInt: TIdentToInt;
AIntToIdent: TIntToIdent);

C++

extern DELPHI_PACKAGE void __fastcall RegisterIntegerConsts(void * AIntegerType, TIdentToInt AIdentToInt, TIntToIdent AIntToIdent);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes System.Classes

Description

Registers conversion functions for string identifiers that represent type values.

RegisterIntegerConsts (which can only be called in Delphi) registers conversion functions for type identifiers. Call RegisterIntegerConsts from the initialization section of the unit that defines an integer-based type and a set of strings that represent the values of that type.

AIntegerType is a pointer to the type information for the integer-based type whose values are represented as strings. Its value can be obtained from the base type using the TypeInfo function.

AIdentToInt is the conversion function that converts strings that are symbolic representations of values to the corresponding integers.

AIntToIdent is the conversion function that converts values that are instances of the base type to the corresponding string representation.

Once the conversion functions are registered, string identifiers can represent type values and the conversion functions are used to convert the string identifiers into the underlying integer values. For example, the TColor type uses this system to convert between the type constants in the Graphics unit and numeric TColor values.

See Also