[fpc-devel] TShiftState as enum

Marco van de Voort marcov at stack.nl
Fri Feb 18 08:30:33 CET 2005

> > Older Delphi (and TP?) versions implemented sets of subranges (e.g. set
> > of 510..515) by "stripping" unused bytes in front of the set. The lowest
> > bit in a set variable always had an ordinal value of 2^n, and above set
> > would occupy 2 bytes, equaling an set of (504..519). In newer Delphi
> > versions the lowest bit exactly corresponds to the lowest ordinal value
> > in the range, the above set only occupies one byte (510..517).
> Supported by FPC

{$mode delphi}

type aenum=510..517;
     aset = set of aenum;


xbla.pp(5,25) Error: illegal type declaration of set elements
xbla.pp(10,4) Fatal: There were 1 errors compiling module, stopping

Redone with 200..207;    -> size = 32 byte = 256 element, so the behaviour
of the older version.


More information about the fpc-devel mailing list