RAD Studio VCL Reference
Classes.IdentToInt Function

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

function IdentToInt(const Ident: string; var Int: Longint; const Map: array of TIdentMapEntry): Boolean;
Boolean IdentToInt(const AnsiString Ident, Longint Int, const array of TIdentMapEntry Map);

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

Ident is the string identifier to translate. 

Int returns the corresponding integer value. 

Mapis 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 return and a Name field, which is the string identifier to translate.

Note: In C++, Map_Size is the index of the last entry in Map (one less than the number of elements).
IdentToInt looks for the string specified by Ident as the Name field on an entry in Map. If it finds a match, it sets Int to the corresponding Value field and returns true. If it does not find a match, it returns False. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!