« Reply #2 on: February 03, 2026, 09:45:05 am »
I know: Wiki is not documentation, but it's the only place i found something
https://wiki.freepascal.org/Enum_typeProperties
An enumeration data type definition is ascending if the difference in ordinal value to every right-hand member is ≥ 1. Currently, non-ascending definitions merely emit a note. A set literal using two enumeration values having the same ordinal value, albeit represented by different symbols, will not be accepted.
An enumeration data type is contiguous if the ordinal value of every (named) member has an absolute difference of one to its neighbors. Using a set constructor on a non-contiguous enumeration data type may produce unexpected results.
An enumeration data type is normal if it is ascending and contiguous and the first member has an ordinal value of (strictly speaking) zero, or, in the broad sense (as implemented by the FPC), ≤ 0. The compiler intrinsic typeInfo is only available for those enumeration data types.
Because this works. all other combinations fail
type
{$M+}
TTest1 = (t1A, t1B);
TTest2 = (t2A = -1, t2B = 0, t2C = 1); //<--
begin
WriteLn(GetEnumNameCount(TypeInfo(TTest1)));
WriteLn(GetEnumNameCount(TypeInfo(TTest2)));
ReadLn;
end.
« Last Edit: February 03, 2026, 09:58:15 am by Zvoni »

Logged
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad