Contents | Prev | Next

15.9 Number of set elements

Irie Pascal uses two different representations for values of set types, depending on the range of the sets base type, or if the base type is a subrange type depending on the range of the subranges host type. Suppose you have the set types

   set of T

and

   set of S
where S is a subrange of T then if T's range is less than or equal to 256 then both sets are represented as bit sets, if T's range is greater than 256 then the sets are represented using an array representation of fixed size.

Why does this matter? Well, because the fixed size of the array representation means that there is a limit (of 255) on the number of set elements that can fit in set variables that use the array representation. If you assign a set value with more elements than the limit then the set value will overflow and overwrite the memory that follows the variable. If assignment overflow checking is enabled then the overflow will be detected.

Contents | Prev | Next