🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #35812

my LSP 2.0 hangs on EventAvail...

#35812
From: Murat N. Konar
Date: Sun, 25 Dec 1988 23:48
45 lines
2120 bytes

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.  
 .
 
Technical Details
Message-ID: <13912@srcsip.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!shamash!rosevax!ems!srcsip!pavo!mnkonar

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!shamash!rosevax!ems!srcsip!pavo!mnkonar
From: mnkonar@pavo.SRC.Honeywell.COM (Murat N. Konar)
Newsgroups: comp.sys.mac,comp.sys.mac.programmer
Subject: my LSP 2.0 hangs on EventAvail...
Message-ID: <13912@srcsip.UUCP>
Date: 25 Dec 88 23:48:12 GMT
Sender: news@src.honeywell.COM
Reply-To: mnkonar@srcsip.UUCP ()
Organization: Honeywell Systems & Research Center, MPLS, MN
Lines: 45