[fpc-pascal] evaluation of set constant

Torsten Bonde Christiansen tc at epidata.dk
Wed Dec 22 14:15:47 CET 2010


Hi List.

Is it possible to create a constant of a set that is based on an 
evaluation of other constants? (using fpc 2.4.2)

A basic case could look like this:

type
   TMyType = (a, b, c ,d);
   TMyTypes = set of TMyTypes;

const
   SetX:        TMyTypes = (a, b);
   SetY:        TMyTypes = (c, d);
   SetCombined: TMyTypes = SetX + SetY;   // this gives me an "Error: 
Illegal expression"

I have been reading throught the FPC docs, but it is unclear whether 
this is possible at all. The set operators allow this and according to 
FPC doc section on constants some expression evaluation is possible.

Kind regards,
Torsten Bonde Christiansen.
EpiData Association.



More information about the fpc-pascal mailing list