Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!umriscc!mcs213f.cs.umr.edu!mcastle From: mcastle@mcs213f.cs.umr.edu (Mike Castle (Nexus)) Newsgroups: comp.lang.pascal Subject: Re: Help Me!!! What's wrong with this simple problem? Message-ID: <1762@umriscc.isc.umr.edu> Date: 28 Nov 90 20:45:39 GMT References: <28893@shamash.cdc.com> <1990Nov28.090232.2958@uwasa.fi> <1990Nov28.180310.3147@aftermath.waterloo.edu> Sender: news@umriscc.isc.umr.edu Organization: University of Missouri - Rolla Lines: 67 In article <1990Nov28.180310.3147@aftermath.waterloo.edu> nmouawad@water.uwaterloo.ca (Naji Mouawad) writes: >In article <1990Nov28.090232.2958@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes: >>In article <28893@shamash.cdc.com> mpe@shamash.UUCP (Mike Ebsen) writes: >>>What's wrong with this problem in Turbo Pascal 5.0... >>> (* program we all know by heart now delted *) >>> >>>My compiler tells me that the assignment of -7 into i (an integer) >>>is an error. >> (* Timo's response also deleted *) > >Or it may be a bug in tp5.0 . I ran this program yesterday and >I ran it today twice (with {$R+}) in tp5.5 and it ran like a >charm. No syntax errors, no sweat. > >Anybody out there with tp5.5 could confirm that ? Or is my >version of tp5.5. a freak ? > >--Naji (* Naji's sig deleted *) It's a freak. :-> Seriously, I just ran it on my Turbo 5.5, and it crashes. I get: Error 201: Range check error. Hmm... I did just discover something unusual , though. I compiled it with just the options changed in the compiler, no compiler directives. The programs running depended on the the Range checking option under the Options/Compliler menu. I Then tried with compiler directives. Got the same results. It ran with range checking off, giving -7 for i. Crashed with error with range checking on. I then tried toggling the options/compiler/range checking menu option to see if it had any effect. It didn't as long as the compiler directive was in the file. This is how it should be. Compiler directives in code take precedence over menu chosen compiler options. Now, I removed the compiler directive from the file. The option menu still has no effect!!! My last source code compiler directive was {$R+} and naturally it crashed. I removed it from the file by typing spaces over it. Now, no matter what the options/compiler/range checking option is, it will not run. I then deleted the entire line, and we're back to normal. Correction, we're not. Still flakey. Hmm... interesting. I believe we've found a compiler bug. Never mind, I'm a bone-head. :-> I just realized that I wasn't recompiling after I changed the option via the menu, just re-running what was in memory. But, when I changed the source code to turn on/off range checking, it automatically recompiled it. Well, if nothing else, I've learned to hit alt-f9 first, THEN cntrl-f9. I wonder if there's an option to change it into auto-matically compile every time it's run.... time to pull out the manuals.... I really should not post this considering what a fool I've made myself, but maybe it'll point out some problems others are having (yeah, right :-) *sigh* and just after a data structures test too.... -- Mike Castle (Nexus) S087891@UMRVMA.UMR.EDU (preferred) | ERROR: Invalid mcastle@mcs213k.cs.umr.edu (unix mail-YEACH!)| command 'HELP' Life is like a clock: You can work constantly, and be right | try 'HELP' all the time, or not work at all, and be right twice a day. |