Or use 0
and let the compiler decide. This was the original pascal/Wirthian way to solve this. Some machines can subdivide large registers easily, and some not.
Wooooo
what is it?
It is a subrange type, only in this case an
anonymous subrange type. The compiler knows what underlying type it provides for the variable, but since the programmer has not named it, it is not readily accessible.
If you want to use the type say in a parameter list you would have to name it
Then you could use it in code like this
function SmallToStr(aSmall: TSmall): string;
begin ...
I don't know if the compiler consistently applies the same type to such constructs across all platforms, but on my Linux 64-bit computer the following program
program Project1;
uses typinfo;
var
i: 0..20;
pti: PTypeInfo;
begin
pti:=TypeInfo({%H-}i);
WriteLn(GetEnumName(Typeinfo(TTypeKind),Ord(pti^.Kind)));
ReadLn;
end.
yields tkInteger.