User Tools

Site Tools


itemize_enumeration_data_structure_.htm
Navigation:  Language Reference > 2 - Program Source Code Format > Compiler Directives >====== ITEMIZE (enumeration data structure) ====== Previous pageReturn to chapter overviewNext page

[label]   ITEMIZE( [ seed ] ) [,PRE( )]

                            equates

            END

blk2blue.jpg

label An optional label for the ITEMIZE structure.
ITEMIZE An enumeration data structure.
seed An integer constant or constant expression specifying the value of the first EQUATE in the structure.
PRE Declare a label prefix for variables within the structure.
equates Multiple consecutive EQUATE declarations which specify positive integer values in the range 0 to 4,294,967,295.

An ITEMIZE structure declares an enumerated data structure. If the first equate does not declare a value and there is no seed value specified, its value is one (1). All following equates following the first increment by one (1) if no value is specified for the subsequent equate. If a value is specified on a subsequent equate, all equates following that continue incrementing by one (1) from the specified value.

Equates within the ITEMIZE structure are referenced by prepending the prefix to the label of the equate (PRE attribute–PRE:EquateLabel). If the ITEMIZE structure has an empty prefix, then the equates are referenced by prepending the ITEMIZE label to the label of the equate (label:EquateLabel). If there is no prefix or label, then the equates are referenced by their own label without a prefix.

Example:

  ITEMIZE

False EQUATE(0)       !False = 0

True  EQUATE          !True = 1

  END

Color ITEMIZE(0),PRE !Seed value is zero

Red    EQUATE         !Color:Red = 0

White  EQUATE         !Color:White = 1

Blue   EQUATE         !Color:Blue = 2

Pink   EQUATE(5)      !Color:Pink = 5

Green  EQUATE         !Color:Green = 6

Last   EQUATE

  END

Stuff ITEMIZE(Color:Last + 1),PRE(My)   !Constant expression as seed

X     EQUATE                             !My:X = Color:Last + 1

Y     EQUATE                             !My:Y = Color:Last + 2

Z     EQUATE                             !My:Z = Color:Last + 3

  END

See Also:

EQUATE

PRE

itemize_enumeration_data_structure_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)