8.2.4 Enumeration types

By default all enumerations are stored as a longword (4 bytes), which is equivalent to specifying the f$Z4g, f$PACKENUM 4g or f$PACKENUM DEFAULTg switches.

This default behavior can be changed by compiler switches, and by the compiler mode.

In the tp compiler mode, or while the f$Z1g or f$PACKENUM 1g switches are in eect, the storage space used is shown in table (8.1).


Table 8.1: Enumeration storage for tp mode

# Of Elements in Enum.Storage space used


0..255 byte (1 byte)
256..65535 word (2 bytes)
> 65535 longword (4 bytes)



When the f$Z2g or f$PACKENUM 2g switches are in eect, the value is stored on 2 bytes (word), if the enumeration has less or equal then 65535 elements, otherwise, the enumeration value is stored as a 4 byte value (longword).