[futurebasic] Re: event loops

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1998 : Group Archive : Group : All Groups

From: Chris <staz@...>
Date: Thu, 29 Jan 98 10:24:13 -0500
>The 1995 FB2 handbook enjoins us (page 55) not to use more than one event
>loop in a program. Why? So far as program logic is concerned there should
>be no trouble as long as the loops do not interfere and the FN doDialog s
>are redefined in appropriate places.
>
>It would be useful to have several event loops in one program, for example
>when combining several different programs, each with its own event loop
>into one.

I need to add to this discussion.

Your "ON DIALOG" style statements set up a single set of vectors for 
events. Attempting to force modality by building multiple loops is an 
impossibility. (Event if you have multiple sets of ON DIALOG vectors 
which quadruples the nightmare.) When you think you are processing from 
one particular place, you'll find events executing somewhere else. 
Attempts to flush events that are not pertinent are disastrous. You can't 
flush update events. You end up dumping menu events when the user just 
really wanted to open a control panel or turn on balloon help. Background 
updates can't take place.

Working around all of the problems caused by this style of programming is 
beyond most programmers. I will be the first to say that I cannot handle 
a program with several event loops. There is probably 100 times more work 
involved in fighting the system than there would be in going along for 
the ride. You just need to change your way of thinking. (Think Different.)

Pizza, Pizza,

-STAZ   ~)~

--------------------------------------------------------------
STAZ Software * 4387 Leisure Time Dr * Diamondhead, MS 39525
--------------------------------------------------------------
Orders: 800-348-2623      EMail http: //www.stazsoftware.com
  Tech: 601-255-7085             FAX: 601-255-7086     
--------------------------------------------------------------