Consider:
{$R+}
i:= 1;
While i > 0 do
i:= i + 1;
ShowMessage(IntToStr(i));
If I declare i
as Byte, Word, Shortint or TinyInt I get a range-check error, as expected.
If I declare i
as LongWord, Cardinal, Integer, LongInt or Int64 it just goes through the while loop and gets to show the negative or 0 value, which i
gets when you pass the upper bound.
Does Delphi 7 not support range checking for 32-bit and 64-bit numbers?