home *** CD-ROM | disk | FTP | other *** search
- .Using Broadcasts vs. Commands
-
- COMMENTS
- --------
- Demonstrate the difference between "evCommand" and "evBroadcast".
- This is a very simple program, with two (2) menu selections and three
- (3) events.
-
- SHAZAM looks in the *.EVT file and extracts routines with the
- following prefixes:
-
- PREFIX HANDLEVENT (*.HE) file
- ------ ----------
- "hb" create an entry in "HandleBroadcast"
- "hd" create an entry in "HandleCommand"
-
- Examine the generated code; if you are less than certain about how
- the code behaves, use the TP IDE/Debugger to "Trace" the chain of
- events, to see how "events" are routed and handled.
-
- +-------+
- |MENUBAR|
- +-------+ +------+
- Send direct ---------------------> |Single|
- Send broadcast ---------------------> |Event |
- |Queue |
- +------+
- |
- +-----------+ |
- | GetEvent | <------------+
- +-----------+----+
- |
- +-----------+ <--+
- +----- |HandleEvent| <---------------+ tagged "evBroadcast"
- | +-----------+ |
- | | |
- | | | "Message" calls
- \/ \/ | ^.HandleEvent
- HandleBroadcast HandleCommand |
- ("evBroadcast") ("evCommand") |
- --------------- ------------- |
- SendIndirect SendBroadcast -----+
- | SendDirect
- | |
- \/ \/
- +------------+
- |"MessageBox"|
- +------------+
-
- @PA - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- [ MENUBAR ]
- 'send ~d~irect' ;;invoke "MessageBox" directly
- 'send ~b~roadcast' ;;invoke "MessageBox" via broadcast
-