On 5 apr 2004, at 12:12, [EMAIL PROTECTED] wrote:
[snip]L:=-1; qw:=qw+(-L); { qw=99 O.K. } (* qw:=qw-L; { run time error 201 } qw:=qw+L; { run time error 201 } *)
Could somebody help me what's wrong ?
The problem is that the compiler has to convert both operands to the same type when you do an operation. When you are working with the largest supported unsigned type (qword currently), this means that both operands are first converted to qword. -1 is an invalid value for a qword, so you get a range check error.
That's also the reason why Turbo Pascal only supported longint, and not cardinal: it breaks range checking.
Jonas
_______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal