Chapter
10
I
BASIC
Keywords
6
Tests to see if Trigger B2 has been pressed and re-
leased since the last STRIG(6) function was executed.
BASIC returns
a
-1
if
it
has been pressed and
a
0
if
not.
Tests to see if you are currently pressing Trigger B2.
BASIC returns a
-1
if you are pressing
it
and
a
0
if
not.
7
Joystick A is the left joystick and Joystick B is the right joystick.
You must execute
a
STRIG
ON
statement before you can execute
a STRIG function. If you attempt to execute a STRIG function
before you execute a STRIG
ON,
BASIC issues an “Illegal func-
tion call” error. See STRIG/Trap.
You cannot place
a
STRIG function in
a
subroutine that you
branch to
as a
result of an
ON
STRIGO GOSUB statement.
BASIC does not keep track of which button was pressed after the
ON
STRIG() GOSUB statement is executed.
If
you wish to trap
both buttons and perform
a
different procedure for each button,
you must execute
a
STRIGiTrap
for
each button, and you must
branch to different subroutines with different
ON
STRIGO GO-
SUB statements.
Sample
Program
This program tells BASIC to beep whenever the trigger on Joys-
tick A
is
pressed.
10
STRIG
ON
20
IF
STRIG(0)
THEN
BEEP
30
GOT0
20
320