Sign in Join
FPDoc Onlineexperiment

GetEnumValueDef function

In unit LazUtilities

Gets the ordinal position for an enumeration value with the specified name.

Declaration

pascal
function GetEnumValueDef(TypeInfo: PTypeInfo; const Name: string; 
 const DefaultValue: Integer): Integer

Arguments

TypeInfo

Pointer to the type information examined in the routine.

Name

Name for the enumeration value to locate in TypeInfo.

DefaultValue

Default ordinal position for the enumeration value used when Name is not found.

Function result

Ordinal position for the enumeration value with the specified name.

Description

GetEnumValueDef is an Integer function used to get the ordinal position in the specified enumeration type insformation for the value with the given name.

The return value contains the ordinal position in TypeInfo for the enumeration value with the given Name. GetEnumValueDef calls GetEnumValue to find the value in Name in the type information. If the return value is -1, an enumeration value with the specified name is not found in TypeInfo and the value in DefaultValue is used as the return value.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.