Code: Select all
Enumeration MyEnum
#CONST1
#CONST2
EndEnumeration
Define foo.MyEnum
foo = MyEnum\#CONST1 ; Autocomplete would show the two constants.
foo = 2 ; Raises an error, as MyEnum can only be 0 (#CONST1) or 1 (#CONST2).
Procedure FooFunc(int.MyEnum)
;int must be either 0 or 1.
EndProcedure
Code: Select all
DeclareModule EnumTest
Enumeration
#CONST3
#CONST4
EndEnumeration
EndDeclareModule
Module EnumTest : EndModule
bar.i = EnumTest::#CONST4
Debug bar ; Outputs 1, but "bar" can be anything.