[comp.sys.mac] my LSP 2.0 hangs on EventAvail...

mnkonar@pavo.SRC.Honeywell.COM (Murat N. Konar) (12/26/88)

Season's Greetings to you all.

I've just run into a problem that I'm surprised I never ran into before or
that no one else has mentioned.  In LSP 2.0, calling EventAvail and
sometimes GetNextEvent causes my program to hang or otherwise misbehave.
Try this code:

program p;

procedure EvtLoop;
 var 
   myEvent:eventRecord;
   dummy: boolean;
 begin
   repeat
     writeln('at top of loop');
     if EventAvail(everyEvent,myEvent) then
       writeln('EventAvail: ', myEvent.what);
     if GetNextEvent(everyEvent, myEvent) then
       writeln('GNE:', myEvent.what);
   until false;


 begin {main}
  showText;
  EvtLoop;
 end.

 Executing the above code usually results in just the top of the loop
 getting executed (i.e. the only output I get is 'at top of loop') then it
 just hangs. Hitting the bug spray doesn't help either.  Sometimes it does
 work ok but then I hit the bug spray, and get a bizzare bug message like
 "Illegal Instruction" and the finger points to some ridiculous line like
 the "program" declaration.  This happens on two Macs that I've tried it on,
 a MacPlus w/2.5 Megs and a Mac II with 2 Megs. Both were running sytem
 6.0.2 and I tried the Mac II without any Inits. Oh, I also tried the
 example application "TextEditor" that comes with the disks.  It worked fine
 until I removed all the objects and recompiled the project.  Sometimes it
 works, sometimes it doesn't.  When it works, usually all it taked to send
 it south is to use the bug spray to get to LSP, call up a DA (Find File
 should do nicely) and then hit Go. I'm baffled.  Please help.  
 .
 

siegel@endor.harvard.edu (Rich Siegel) (12/27/88)

In article <13912@srcsip.UUCP> mnkonar@srcsip.UUCP () writes:
[Miscellaneous problem with Pascal 2.0 and GetNextEvent]

	Are you running under MultiFinder? 

	This is a problem that I haven't seen before,  either, but I'll
try to reproduce it. In the meantime, try starting afresh with new
copies of Lightspeed Pascal, and with a fresh project document.

		--Rich


Rich Siegel
Staff Software Developer
THINK Technologies Division, Symantec Corp.
Internet: siegel@endor.harvard.edu
UUCP: ..harvard!endor!siegel
Phone: (617) 275-4800 x305

Any opinions stated in this article do not necessarily reflect the views
or policies of Symantec Corporation or its employees.