qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
STRIG Function Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
STRIG Function Details
 
Syntax
  STRIG(n)
 
The STRIG function is used to test the joystick trigger status. In previous
versions of BASIC, the statement STRIG ON enables testing of the joystick
triggers; STRIG OFF disables joystick trigger testing. QuickBASIC ignores
STRIG ON and STRIG OFF statements--the statements are provided for
compatibility with earlier versions.
 
The numeric expression n is an unsigned integer in the range 0-7, indicating
the joystick and trigger to check. The following list describes the values
returned by the STRIG(n) function for different values of n:
 
  Argument   Value Returned
  0          -1 if the lower button on joystick A was pressed since
             the last STRIG(0) call, 0 if not
 
  1          -1 if the lower button on joystick A is currently down,
             0 if not
 
  2          -1 if the lower button on joystick B was pressed since
             the last STRIG(2) call, 0 if not
 
  3          -1 if the lower button on joystick B is currently down,
             0 if not
 
  4          -1 if the upper button on joystick A was pressed since
             the last STRIG(4) call, 0 if not
 
  5          -1 if the upper button on joystick A is currently down,
             0 if not
 
  6          -1 if the upper button on joystick B was pressed since
             the last STRIG(6) call, 0 if not
 
  7          -1 if the upper button on joystick B is currently down,
             0 if not
 
You can also use event trapping to get information from the joystick
by using the ON STRIG statement. You cannot use the STRIG function
inside a joystick event trap because the event that caused the trap is
destroyed.
 
Differences from BASICA
 
If you are compiling from the BC command line, you must use the /V or /W
option if a program contains a STRIG statement.