RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TypInfo.GetEnumValue Function

Returns the value of an enumerated type constant given its string representation.

Pascal
function GetEnumValue(TypeInfo: PTypeInfo; const Name: string): Integer;
C++
int GetEnumValue(PTypeInfo TypeInfo, const AnsiString Name);

Use GetEnumValue to convert the string that represents an enumerated value into the corresponding integer that is its implemented value. 

TypeInfo is the type information record that describes the enumerated type. You can obtain the type information for a type by calling the TypeInfo function in Delphi or using the __delphirtti operator in C++. 

Name is the string that is used in code to represent the enumerated value. 

GetEnumValue returns the corresponding integer value. 

 

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