Delphi – E2028 Sets may have at most 256 elements

In your Delphi program, When you try to declare a set type with more than 256 elements, you get this error notice. More exactly, the upper and lower limits of the base type must have ordinal values in the range 0..255.

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

BigSet has only 256 elements in the example, yet it is still forbidden.

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

We must ensure that the upper and lower bounds are in the 0..255 range.