Enum (Enumerated Values)

An Enum is an enumerated value, that is, a data type which allows you to assign values to names. An Enum data type is always a "Long Constant". For example, you can create an enumerated data type named "enumMy", with three constants (Value1, Value2, and Value3):

Types

===========

enumMy: Enum

{

Value1: Long Const = 1

Value2: Long Const = 22

Value3: Long Const = 36

}

In programming code, you can use the "Value2" as a constant, limited by the rules for scope for that variable. If you have two variables of the same name within the range of scope, for example, two enum constants called "Value2", ATEasy will use the first one it finds. If there is a possibility of duplicate constants, you can use the enumerated type name (or library name, if you wish to refer to a constant in the internal library) as a qualifier, for example,

LX = enumMy.Value2 ! LX is Long

See Also

Arrays, Struct, TypeDef, EnumConst Procedure - v11