* *
*
* * News
  Daily news
  Archived news

Columns
  WildCard
  Qbasic Articles
  QB Comic!

Learning center
  QB Books
  Qbasic Lessons!
  Qbasic FAQ
  Newbies Section
  Qbasic Tutorials

* *
*
*
*
*  
.ON Keyword - Different Usesi

ON Keyword - Different Uses
The ON keyword is used in various statements to trap events:
Specifies a trap          Type of event                    Enables the trap
ON COM(n)         events on communications port n          COM(n) ON
ON KEY(n)         a keystroke on key n                     KEY(n) ON
ON PEN            lightpen events                          PEN ON
ON PLAY(n)        less than n notes in music buffer        PLAY ON
ON STRIG(n)       events on joystick trigger n             STRIG(n) ON
ON TIMER(n)       timer events                             TIMER ON
ON UEVENT         user-defined events                      UEVENT ON
Other uses of the ON keyword are:
ON ERROR - to enable error handling and specify the error-handling routine
ON...GOSUB - to branch to one of a list of subroutines
ON...GOTO  - to branch to one of a list of line labels
* * ** * * * *