System.Classes.IdentToInt

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

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

C++

extern DELPHI_PACKAGE bool __fastcall IdentToInt(const System::UnicodeString Ident, int &Int, TIdentMapEntry const *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 string identifiers into their corresponding integer values.

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

Ident is the string identifier to translate.

Int returns the corresponding integer value.

Mapis an array of records (Object Pascal) 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.

See Also