Newsgroups: comp.sys.apple2.programmer Path: blue.weeg.uiowa.edu!news.uiowa.edu!uunet!comp.vuw.ac.nz!actrix.gen.nz!dempson From: dempson@actrix.gen.nz (David Empson) Subject: Re: Is this an ORCA/Pascal bug? Message-ID: Organization: Actrix Information Exchange References: <389nme$fgd@rrnet.com> Date: Sun, 23 Oct 1994 01:19:27 GMT Lines: 43 In article <389nme$fgd@rrnet.com>, Jason A. Gibb wrote: > Okay you programming gods out there, anyone want to take a crack at this one? > The program segment below keeps dying on the repeat statement with an > inexplicable (and maddening!) "Compiler Error." This is not good. It certainly isn't a helpful error message. There actually is a bug in your code, but the compiler obviously doesn't know how to deal with it. I tried your program with ORCA/Pascal 2.1, and it produced the same error. Here are the relevant parts for the problem. > CONST > About_Window = $1000; > AboutOK_Button = $1001; > repeat > part:=ord(DoModalWindow(dEvent,nil,nil,nil,$0009)); > until part in [AboutOK_Button]; The problem is that AboutOK_Button is out of the valid range of integers for use in a set. The maxmium value is 2047, and you've tried to use 4097. Changing the last line to "until part = AboutOK_Button" avoids the compiler error. While looking into this problem, I found an unrelated error in the Window Manager interface file. The DoModalWindow call is passing the event record by value, not as a pointer. You need to edit the WindowMgr.pas file (in the Tool.Interface directory, which you may not have installed from the distribution disks), and change the first parameter of DoModalWindow to a 'var', then recompile it and copy WindowMgr.int to 13/ORCAPascalDefs. If you don't do this, the program will crash when you run it. I'll pass this on to Mike so that it will be corrected in the next release. -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand