help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'typinfo' (#rtl)

GetEnumValue

Get ordinal value for enumerated type by name

Declaration

Source position: typinfo.pp line 277

function GetEnumValue(

  TypeInfo: PTypeInfo;

  const Name: String

):Integer;

Description

GetEnumValue scans the type information for the enumeration type described by TypeInfo and returns the ordinal value for the element in the enumerated type that has identifier Name. The identifier is searched in a case-insensitive manner.

This can be used to set the value of enumerated properties from a stream.

For an example, see GetEnumName.

Errors

If Name is not found in the list of enumerated values, then -1 is returned. No check is done whether TypeInfo points to the type information for an enumerated type.

See also

GetEnumName

  

Return name of enumeration constant.

SetOrdProp

  

Set value of an ordinal property

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505