Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!ncar!tank!uxc!uxc.cso.uiuc.edu!zaphod!liberte From: liberte@zaphod.ncsa.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: Re: Overflow Checking from within Pasca Message-ID: <900010@zaphod> Date: 10 Oct 88 22:30:00 GMT References: <4276@polyslo.CalPoly.EDU> Lines: 26 Nf-ID: #R:polyslo.CalPoly.EDU:4276:zaphod:900010:000:1260 Nf-From: zaphod.ncsa.uiuc.edu!liberte Oct 10 17:30:00 1988 > Overflow checking checks for integer overflow during computations, >not during assignments. If you want to assign a large unsigned value >to an integer variable, turn off the "R" compile option, or use {$R-}. Wait a second.. You say I should turn off Overflow checking with the Range checking option? Of course, I should have guessed. But in that case what does {$V-} do? Using R-V-, I still cannot turn off overflow checking for the following expression: 128 * 256 But, in a way, I was glad I couldnt because it was my error to not cast to a longint. The only reason I had tried to turn off this overflow check was because it was part of an unsigned integer assignment. (The smallest gradularity for changing overflow checking is the line since one cannot put comments in the middle of lines.) While I am at it, it is not possible to put comments in the Observe window to affect how that code is compiled. Thus I cannot easily debug code that depends on turning off range checking, for example. A case in point, cSpecArray is declared as an Array [0..0] of ColorSpec because it is of variable length. Aside from the difficulty of using this in code, the Observe window does not allow any other index but 0 which is not very useful. Dan LaLiberte