Show: Object Pascal C++
Display Preferences

E2028 Sets may have at most 256 elements (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

This error message appears when you try to declare a set type of more than 256 elements. More precisely, the ordinal values of the upper and lower bounds of the base type must be within the range 0..255.


program Produce;
type
  BigSet = set of 1..256;  (*<-- error message given here*)
begin
end.

In the example, BigSet really only has 256 elements, but is still illegal.


program Solve;
type
  BigSet = set of 0..255;
begin
end.

We need to make sure the upper and lower bounds and in the range 0..255.

Personal tools
In other languages