[fpc-pascal] how to expand a set?

Sven Barth pascaldragon at googlemail.com
Wed Jun 15 20:04:11 CEST 2016


On 15.06.2016 18:20, wkitty42 at windstream.net wrote:
> On 06/15/2016 10:36 AM, Santiago A. wrote:
>> 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
> 
> right... so a set has 0-255 elements and a set of sets would have 0-255
> elements containing one set of 0-255 elements... if all are used, that
> gives 0-65535 elements we can access... or should be able to access...
> if we can figure out how to create it :(

A set is internally a bitfield of a maximum of 256 bits (or 32 bytes),
so you *can't* nest them.

Regards,
Sven



More information about the fpc-pascal mailing list