Futurebasic/Language/Reference/begin enum

Statement
✔ Appearance ✔  Standard ✔  Console

Syntax
begin enum [start [,inc]] _constName1 [= staticExpression1] _constName2 [= staticExpression2] _constName3 [= staticExpression3] _constName4 [= staticExpression4] end enum

Description
This statement begins a block of "enumerated constant" definition lines. The block must be terminated with the  statement. All of the constants defined in this block are global, regardless of where in the program the block appears.

The  block is "non-executable," which implies that it won't be repeated or skipped if it appears within any kind of "conditional execution" block, such as ,  ,  , etc. (but it can be conditionally included or excluded if it appears inside a   block).

Each  represents a symbolic constant name that has not previously been defined, and each   represents an integer expression which consists only of:  integer literal constants; previously-defined symbolic constant names; operators (like +, -, *, /, &gt;, =); parentheses  (In particular, it can't contain variables, nor function references.) The  block assigns values to each of the   symbolic constants as follows:  If the  is followed by , then   is assigned the value of  ; If the  is not followed by , then   is assigned the value of the   in the line above it, plus the value of  ; If the very first  is not followed by , then it's assigned the value of.  The  and   parameters, if included, must each be a static integer expression. The default value of  is 0, and the default value of   is 1.

Example
In the following, the dwarves are assigned values of 1 through 7;  is assigned the value 100, and   is assigned the value 101. begin enum 1 _docDwarf _sneezy _grumpy _sleepy _dopey _happy _bashful _snowWhite = 100 _thePrince end enum