[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'LazUtilities' (#lazutils)

GetEnumValueDef

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

Declaration

Source position: lazutilities.pas line 29

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

GetEnumValue

PTypeInfo


Version 4.0 Generated 2025-05-03 Home