From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function GetSetElementValue(TypeInfo: PTypeInfo; const Name: string): Integer;


extern DELPHI_PACKAGE int __fastcall GetSetElementValue(PTypeInfo TypeInfo, const System::UnicodeString Name);


Type Visibility Source Unit Parent
function public
System.TypInfo System.TypInfo


Returns the integer representation of a given constant identified by its name.

Use GetSetElementValue to convert a constant identified by its symbolic name to an integer.

TypeInfo is the type information record that describes the type for which the constant has a meaning. You can obtain the type information for a type by calling the TypeInfo function in Object Pascal or the __delphirtti operator in C++.

Value is the constant, represented as a string.

GetSetElementValue returns the integer that represents the specified value.

If TypeInfo describes an Integer type, Value is assumed to be a string representation of an integer and is converted to an integer. If TypeInfo describes a char type, an integer containing the character code is returned. If TypeInfo describes an enumerated type, GetEnumValue returns the integer representation of Value.

See Also