RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Classes.IntToIdent Function

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

Pascal
function IntToIdent(Int: Longint; var Ident: string; const Map: array of TIdentMapEntry): Boolean;
C++
Boolean IntToIdent(Longint Int, AnsiString Ident, const array of TIdentMapEntry Map);

Classes

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!