HTBasic Help
×
Menu
Index

Off Event Command

 
OFF EVENT
Cancels event branches defined by ON EVENT
______________________________________________________________________
 
Legal Usage                Keyboard Executable                Yes
                 Programmable                        Yes
                 In an IF...THEN...                        Yes
 
Example                                OFF EVENT @Pushbutton_3,"ACTIVATED"
Statements                                OFF EVENT @Slider, "DONE"
 
Syntax
 
 
Item
Description
Range
event name
name of an event this widget can generate
depends on the widget
widget handle
name identifying a widget
any valid name
 
Description
 
The OFF EVENT statement undefines and disables a widget event that was defined and enabled earlier by an ON EVENT statement.
 
In the following example, the first line causes the program to go to the subroutine Event_handler when the SLIDER widget event CHANGED occurs. Then, the next line cancels the event branch. Thus, after the second line, the occurrence of the event CHANGED will not cause a branch to Event_handler.
 
    ON EVENT @Slider;"CHANGED" GOSUB Event_handler      .
                .
    OFF EVENT @Slider, "CHANGED"
 
There are three important differences between the OFF EVENT and DISABLE EVENT statements:
 
·
DISABLE EVENT temporarily disables the event, whereas OFF EVENT permanently deactivates the event.
 
·
Only one occurrence of the event will be logged if the event is disabled with a DISABLE EVENT statement. Therefore, the branch will be taken once the event is reenabled with an ENABLE EVENT statement.
 
·
The event will NOT be logged and the branch will never be taken if the event is deactivated with an OFF EVENT statement.