info(“runninghandler”)

The info(“runninghandler”) function returns true if the current procedure is running as a “handler” procedure.


Description

Panorama procedures are usually triggered by relatively “hi-level” events like clicking on a button or choosing from a menu. However there is a special type of procedure that is triggered by more low level events like simply bringing a window to the front. These “event handler” procedures (also called simply “handler procedures”) let you control how Panorama responds to these low level events.

Internally, event handler procedures work slightly differently than regular procedures. When an event handler procedure is triggered, Panorama stops everything and runs that procedure immediately. If a regular procedure causes the event handler procedure to trigger, the regular procedure will pause and wait for the event handler procedure to finish before continuing.

Event handler procedures are intended for changing the way Panorama responds to various low level events. An event handler procedure cannot contain any statements that would cause more low level events. In practical terms this means that an event handler procedure cannot change the arrangement of windows on the screen in any way - it cannot bring another window to the top, open a new window, close a window, or open or close any files. You cannot use the debugger with event handler procedures, because the debugger itself generates low level events. An error dialog will appear if your event handler procedure attempts to perform a statement that would cause another low level event. Event handler procedures should not pause for user input unless you really want to annoy your users. (However, it can sometimes be convenient to use a message statement to help debug an event handler procedure.)

Event handler procedures should be as short as possible. Extra delays in processing low level events will be very noticeable. The event handler procedure should only deal with the event in question and should not contain any other logic for your application. If possible an event handler procedure should be written with one or two simple statements or formulas.

Sometimes the same procedure may be triggered in different ways – sometimes as a normal procedure, sometimes as an event handler procedure. In that case the procedure can use the info(“runninghandler”) function to determine what mode the procedure is currently running in. This function returns true if the procedure is running as an event handler, false if the procedure is running as a normal procedure.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0