I know sets can't have more than 255 elements in FPC, however, are negative integers allowed?
I've stumbled upon this and haven't been able to find anything related to it online.
PROGRAM test;
TYPE rg = -10..0;
negatives = set of rg;
I get this compiling error.
test.pas(3,25) Error: illegal type declaration of set elements
I suspect this error comes from the negative integers because if i define the range as 0..5 for example, it compiles alright.
From the Delphi documentation, which typically FP mirrors:
The range of a set type is the power set of a specific ordinal type, called the base type; that is, the possible values of the set type are all the subsets of the base type, including the empty set. The base type can have no more than 256 possible values, and their ordinalities must fall between 0 and 255.
The FreePascal docs says the same thing (not quite as clearly, and somewhat more difficult to find):
Each of the elements of SetType must be of type TargetType. TargetType can be any ordinal type with a range between 0 and 255.