Number of set elements

The maximum number of set elements that can be present in a set value is 256. NOTE: This limit does not apply to the range of the values of set elements in set values. For example in the following program:

program testset;
var
   setvar : set of 1..2000;
begin
 setvar := [1, 1000, 2000];
 writeln(1 in setvar);
 writeln(1000 in setvar);
 writeln(2000 in setvar);
end.

Although the range of values in the set constructor is 2,000, the number of set elements actually present in the set constructor is three, so this program runs without a problem.