Enum Command

Purpose

Declares a set of 32-bit integer constants.

Syntax

Enum v1 [=value] [, v1 [=value]]…

v1, v2:variable name
value:iexp

Description

The elements of the Enum type are initialized to constant values within the Enum statement. The assigned values can't be modified at run time and can include both positive and negative numbers.

By default, the first enumerator has a value of 0, and each successive enumerator is one larger than the value of the previous one, unless you explicitly specify a value for a particular enumerator. Enumerators needn’t have unique values.

An enumeration can be declared Local as well as Global. Without indication an Enum is local when used inside a subroutine. When used in the main part of the program, the enumeration has global scope.

Example

Enum saturday,         /* saturday = 0 by default */ _

sunday = 0,          /* sunday = 0 as well */ _

monday,              /* monday = 1 */ _

tuesday,             /* tuesday = 2 */ _

wednesday, _

thursday, _

Friday

Remarks

See Also

Const

{Created by Sjouke Hamstra; Last updated: 04/10/2014 by James Gaite}