On Mon, 09 Aug 1999 10:57:51 +0200, Gautier wrote: >If they have kept compatibility from Turbo Pascal, there is >a total casting between byte (unsigned_8), short_integer (integer_8), >word (unsigned_16), integer (integer_16), longint (integer_32)... > >The bugs from unsigned <-> signed are the most vicious. There's also the wrap arounds (so I always keep range checking enabled.) >Has this changed in Delphi (read: have they "Adaized" this) ? Not with Delphi 4 (but version 5 is supposed to get out this month :-). Here's from the doc of Delphi 4: "If an operand�s type is a subrange of an integer type, it is treated as if it were of the integer type." (Oplg.pdf - Object Pascal Language Guide, p. 4-7) "Performing arithmetic on signed and unsigned Integers results in all values being promoted to Int64 to avoid potential overflow." (del4new.hlp - Compatibility issues) I just tried this <<<<<<<<<< {$RANGECHECK ON} var n1, n2: shortint; {range: -128 .. 127} N: integer; {range: 2147483648 .. 2147483647} begin n1:= 120; n2:= 120; N:= n1 + n2; Writeln(N); end; >>>>>>>>>> The result was, appropriately 240. Now, if I know that n1 and n2 are both in the range -128..127 while their sum is outside this range, I don't understand what's wrong with assigning (n1 + n2) to an integer. Andre