Last Modified: 1/4/2021

Sets the line label of code to run during an Interrupt.


Interrupt System Identifier Yes The type of Interrupt you are setting up.
Label Line Label Yes The label where the code you wish to execute during the Interrupt.

Interrupt Types

ExtInt, InterruptExtInt Sets the routine for the external interrupt.
HBlank, hInt, InterruptHBlank Sets the routine for the horizontal interrupt.
InterruptVBlank, VBlank, vInt Sets the routine for the vertical interrupt.


Syntax: On <Interrupt> Gosub <Label>
    On vInt GoSuB MyVblank
    Enable vInt
    While 1
        Locate 1,1
        Print b
        Sleep 1
    If a = 60 Then
        a = 0
    End If


The code found at Label needs to have a Return command at the end.

The vertical interrupt executes 60 times per second on NTSC systems, and 50 times on PAL. The horizontal interrupt is significantly shorter in time, and is generally used for raster effects.

Due to the horizontal interrupt wrapper in the BASIC library, very few rasters can actually be done in SecondBASIC Studio.

See Also

Disable, Enable, GoSub, HBlank, Return