Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amiga.amiga.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!harvard!talcott!panda!genrad!decvax!decwrl!pyramid!amiga!dale From: dale@amiga.UUCP (Dale Luck) Newsgroups: net.micro.amiga Subject: Re: Fun with gadgets Message-ID: <394@amiga.amiga.UUCP> Date: Thu, 12-Dec-85 23:34:18 EST Article-I.D.: amiga.394 Posted: Thu Dec 12 23:34:18 1985 Date-Received: Mon, 16-Dec-85 03:49:14 EST References: <338@well.UUCP> Reply-To: dale@tooter.UUCP (Dale Luck) Organization: Commodore-Amiga Inc., 983 University Ave #D, Los Gatos CA 95030 Lines: 31 In article <338@well.UUCP> crunch@well.UUCP (John Draper) writes: >/*************************************************************************** > MAIN EVENT LOOP >***************************************************************************/ > > for (;;) > { > > if (message = (struct IntuiMessage *)GetMsg(w->UserPort)) { > MessageClass = message->Class; > code = message->Code; > ReplyMsg(message); > switch (MessageClass) { > } /* Case */ > } /* if */ > } /* for */ >} /* main */ > This is similar to the loop I had in the dot.c program If your program does need to do anything while waiting for messages though you should use for (;;) { Wait(1<UserPort->mp_SigBit); /* wake up when message there */ if (message = (...... etc. } This will be much more fair to those other programs and to intuition as well.