bwbecker@violet.waterloo.edu (Byron Weber Becker) (01/12/88)
I've encountered my first really flaky behaviour in LightSpeed Pascal after MANY months of very good service. I made a number of changes to a 700 line unit. During recompilation I got an error message: "The code generator has detected error number 210." What is this? It failed in the middle of a case statement that used a with statement. Removing the "with" seemed to solve the *immediate* problem. The code that gave error 210 was something like: case i of AveSort: .... MinSort: begin .... with SomeVariable^ do begin if Position[Loc] then... *** failed on line above. Replacing *** Loc with SomeVariable^.Loc and *** removing the "with" statement *** got past this section of code. end; end; MaxSort:... end; Next strange behaviour that I have *not* found a work- around for (this showed up at the same time as the above -- ie: I have not has a successful run since the above appeared): for i:= 1 to 8 do begin ... (1) if Position[i] = 1 then ... ... end; At line (1) I get a run-time error that i is out of bounds. The Observe window shows i = 9! What gives? It is a very simple stretch of code that was not modified since the last time it ran successfully. It involves no procedure or function calls. This procedure is printing values to a window that come out completely wrong. The Observe window and LightsBug show the expected values (not the values it printed) when I inspect the variables. Environment: This is on LSP v1.0 on a 128K-upgraded-to-512K Mac (I know, Stone Ages) with 2 400K drives. The project consists of about a dozen units, totalling about 2000 lines of code. The application's heap is set at 96K. If anyone has any clues on this one, I'd be more than happy to hear from you. Another question: what is the most recent version of LSP that can run reasonably on my machine (512K, 2x400K drives)? Thanks, Byron Weber Becker University of Waterloo
rs4u+@andrew.cmu.edu (Richard Siegel) (01/15/88)
Indeed, the construct you descibe was known to cause code problems in Lightspeed Pascal 1.0. As for your FOR loop: are you using the StringOf function? The StringOf supplied with 1.0 trashed registers, which tended to screw up most looping constructs. The current version is 1.11. There is a patch available, downloadable from comp.binaries.mac or from info-mac on SUMEX, which should help quite a bit. It fixes the CG and StringOf bug, among other things. The new version also fixes compatibility problems with new hardware and software configurations. --Rich