System.Classes.IntToIdent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function IntToIdent(Int: Integer; var Ident: string; const Map: array of TIdentMapEntry): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall IntToIdent(int Int, System::UnicodeString &Ident, const TIdentMapEntry *Map, const int Map_High);

Properties

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

Description

Uses a mapping array to convert integers into their corresponding string identifiers.

IntToIdent provides the underlying translation from string identifiers to integers that occurs, for example, when you register a mapping using the RegisterIntegerConsts procedure in Delphi.

Int is the integer to translate.

Ident returns the corresponding string identifier.

Map is an array of records (Delphi) or structs (C++) that describe the mapping. Each member of the array contains a Value field, which is the integer value to translate and a Name field, which is the corresponding string identifier.

Note: In C++, Map_Size is the index of the last entry in Map (one less than the number of elements).

IntToIdent looks for the integer specified by Int as the Value field on an entry in Map. If it finds a match, it sets Ident to the corresponding Name field and returns true. If it does not find a match, it returns false.

See Also