[fpc-pascal] how to expand a set?

Santiago A. svaa at ciberpiula.net
Wed Jun 15 16:36:57 CEST 2016


El 15/06/2016 a las 15:55, wkitty42 at windstream.net escribió:
>
> what is the best/easiest way to increase the size of a set if the set
> is defined as the following?
>
>
>   const
>     CMaxCount  = 255;
>
>   type
>     TMsgAreas  = set of 0..CMaxCount;
>
>   var
>     MsgAreas   : TMsgAreas;
>
>
> is a set of sets possible?
No, the base type of a set must be an ordinal type. Enumeration type and
integers. And the base type can't have more 255 elements
> how is a set of sets defined?
No
> how are the elements in the sets accessed?
??
What do you mean with "access"?
You can't access the element of a set, you can say if the an element is
in a set or not.

msgAreas:=[1..7];

if (2 in msAreas) then .......

-- 
Saludos

Santiago A.




More information about the fpc-pascal mailing list