* If the initialization routine "steals" an interrupt used by another service routine, the original address MUST be restored before the program terminates.
:# Write an event-handling routine using [[CALL]] '''SetUEvent''' and add it to your program.
:# Use the ON UEVENT GOSUB statement to specify the user-defined event procedure.
:# Use the UEVENT ON statement to enable event trapping.
:# Call the interrupt-initialization routine to insert the address of the service routine into the interrupt vector table.
* When the specified interrupt occurs, the execution is transferred to the interrupt service routine. The service routine collects and stores the data the user wants. It then calls '''SetUEvent'''. SetUEvent sets a flag checked by QuickBasic before going to the next code statement(or label if using BC.EXE compiler option /W instead of /V ). When the flag is set, control transfers to the event-handling routine in ON EVENT GOSUB.
* The '''SetUEvent''' procedure is a part of QuickBasic, and is included in compiled programs or when the QuickBASIC IDE is run with the /L command-line option. Your interrupt service routine must [[CALL]] SetUEvent.
* If you want to return a value, you must write a procedure for your program to call. (It would usually be called by your event-handling routine.) The function must be [[DECLARE]]d.
* Although ON UEVENT GOSUB ties an event-handling routine to a user-defined event, it does not enable the event trap. The [[UEVENT]] statement is used to enable, disable, and suspend user-defined event trapping.