FutureBasic Logo

<<    Index    >> FutureBasic 5

begin enum   statement



Syntax:
begin enum [start [,inc]]
  _constName1 [= staticExpression1]
  _constName2 [= staticExpression2]
  
  
end enum

Description:
This statement begins a block of "enumerated constant" definition lines. The block must be terminated with the end enum statement. All of the constants defined in this block are global, regardless of where in the program the block appears.
The begin enum...end enum 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 for...next, long if...end if, do...until, etc. (but it can be conditionally included or excluded if it appears inside a #if block).
Each _constName represents a symbolic constant name that has not previously been defined, and each staticExpression represents an integer expression which consists only of:
In particular, it can't contain variables or function references.
The begin enum block assigns values to each of the _constName symbolic constants as follows:
The start and inc parameters, if included, must each be a static integer expression. The default value of start is 0, and the default value of inc is 1.

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