Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>on strig trap for specified joystick button</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ON STRIG                 Trap for Specified Joystick Button

 ON STRIG(n) GOSUB {linenum | linelabel}

    Establishes a subroutine to which Turbo Basic will branch if a
    specified joystick button is pressed. The trap must also be turned on
    by means of a STRIG(n) ON statement.

           n    A numeric expression indicating the button to be trapped.
                Must be 0, 2, 4, or 6. The meaning of n is as follows:

                              0    button A1
                              2    button B1
                              4    button A2
                              6    button B2

     linenum    The first line of the joystick-handling subroutine.
                Setting linenum to 0 disables trapping.

   linelabel    A label identifying the first line of a joystick-handling
                routine.

   --------------------------------------------------------------------------

      Notes:    With trapping in effect, Turbo Basic checks to see if the
                specified joystick button has been pressed. When the
                button has been pressed, Turbo Basic branches to the
                specified subroutine and temporarily suspends trapping (by
                means of an implicit STRIG(n) STOP statement). Trapping
                automatically resumes when a RETURN from the handling
                subroutine is executed (unless the handler explicitly
                performs a STRIG(n) OFF or STRIG(n) STOP).

                Downstrokes that cause joystick button trapping do not set
                functions STRIG(0), STRIG(2), STRIG(4), or STRIG(6).

                With event trapping in effect, Turbo Basic checks for the
                specified event after each program statement. The $EVENT
                metastatement can be used to turn event trapping on and
                off at specified points within a program.

See Also: $EVENT STRIG (Function) STRIG (Statement)

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson