FutureBasic Logo

<<    Index    >> FutureBasic 5

on dialog   statement

on dialog {fn userFunction|gosub{lineNumber|"stmtLabel"}}

This statement designates a particular function or subroutine as a dialog-event handling routine. A dialog-event handling routine is called in response to a number of different kinds of user actions and internal events; see the dialog function for more information.
After a dialog event occurs, FutureBasic does not call your designated routine immediately. Instead, your program continues executing until a HandleEvents statement is reached. At that time, HandleEvents will call your designated routine once for each dialog event that occurred; your designated routine should examine the dialog(0) and dialog(evnt) functions to get information about the event. If you have not designated any dialog-event handling routine, FutureBasic ignores events of this kind.

If you use the on dialog fn userFunction syntax, then userFunction must refer to a function which was defined or prototyped at an earlier location in the source code. Your dialog-event handling function should not take any parameters, nor return a result.

See Also:
dialog function; dialog statement; HandleEvents