|Top Previous Next|
An enumeration is a group of related constants.
Unless specified otherwise, constants in the group are automatically assigned incrementing values, counting from 0.
As a result of the enumeration definition a new variable type is created. You can then define other variables of this type.
Members defined in the enumeration construct are independent constants.
Enumeration types in Tibbo BASIC
Enumeration types in Tibbo C
Enumeration types are understood by the Watch and the parser
Add an enum-type variable to the Watch pane and the latter will not only show this variable's numerical value, but also the constant associated with it!
The parser also understands enums. Type dayofweek= (for the examples above) and the parser will pop up a list of available choices!
Type mapping for enums
When the project is being compiled, all enumeration types are substituted with plain numerical values.
It's not possible to use fractional values in enums.