HTBasic Help
×
Menu
Index

OFF EVENT

Cancels event branches defined by ON EVENT
 

Example

                         
OFF EVENT @Pushbutton_3,"ACTIVATED"
OFF EVENT @Slider, "DONE"
 

Syntax

 
OFF EVENT @w_hndl, event_name
 
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"
 
Note that 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 DISABLE EVENT. Therefore, the branch will be taken once the event is re-enabled with ENABLE EVENT.
 
The event will NOT be logged and the branch will never be taken if the event is deactivated with an OFF EVENT statement.