Yes, but the ordering is by virtue of the ordinal base type. It says nothing about the ordering of the storage.
MarkMLl
It is NOT by virtue of the ordinal base type. ONLY an ordinal type can be used because there must be a 1 to 1 correspondence between a set element and a bit that represents the set element.
For instance, the range TRANGE = 500..550 is most definitely an ordinal base type but, it is not "virtuous" enough to be used in a Pascal set (at least not an FPC one.) Therefore: that the base type is an ordinal type is NOT SUFFICIENT, which means, there are countless ordinal base types that cannot be used in the definition of a set because for one reason or another the compiler cannot establish a 1 to 1 correspondence between the type's ordinal values and the bit indexes.
In the case of 500..550, the problem is that FPC cannot use a base other than zero. in a range such as 0..299, the problem is that while the starting ordinal is fine, the ending one exceeds the number of elements that FPC can have in a set. I hope that this makes it crystal clear that "ordinal base type" is totally insufficient.
In the case of FPC, the only ordinal ranges that can be used must be in the range 0..255. if it's not in there, it's not usable because FPC enumerates the set elements 0..255. In case it is not painfully obvious yet, that means FPC orders the elements of the set.
It is the internal implementation of sets in Pascal (and FPC) that puts strict limits on the ordinal types that can be used in a set definition.
In FPC, the ordering of the set elements will always be the same 0..255 (or less), therefore the ordering is not dependent on the base type, the only thing that is dependent on the base type is the number of elements in the set.
all this is made patently obvious by the following definitions and the corresponding compiler behavior.
type
EnumA = (aa = 5, ab = 10, ad = 255);
EnumB = (ba = 5, bb = 10, bd = 256); { <-- this is an ordinal type }
EnumC = (ca = 400, cb = 410); { <-- also an ordinal type }
var
x : set of EnumA; { 0..255 -> no problem }
y : set of EnumB; { <-- no can do }
z : set of EnumC; { <-- no can do either }