ON
PET VIC-20 C64 C16 Plus/4 C128 X16
The ON … GOTO|GOSUB
construct has multiple use cases:
ON <value> GOTO|GOSUB
is used for multiple branchingON ERROR GOTO
is used for error trappingON <event> GOSUB
is used for interrupt handling
Syntax
ON <value> GOTO|GOSUB <label> [, <label> ...] ON ERROR GOTO <label> ON TIMER|RASTER|SPRITE|BACKGROUND|VBLANK GOSUB <label>
For more details, refer to: