KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q26895: Using Joystick, STRIG(1) Incorrectly Returns 1, Not -1

Article: Q26895
Product(s): See article
Version(s): 4.00 4.00b
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist4.00 buglist4.00b fixlist4.50 B_BasicCom | mspl13_basic
Last Modified: 18-OCT-1989

The joystick buttons are not recognized in the program shown below.
The program incorrectly returns a 1 instead of a -1 when the button is
pressed in programs compiled with QuickBASIC Versions 4.00 and 4.00b
and with Microsoft BASIC Compiler Versions 6.00 and 6.00b for MS-DOS
(buglist6.00, buglist6.00b).

This problem was corrected in Microsoft QuickBASIC Version 4.50.

The problem does not occur in QuickBASIC Version 3.00, which correctly
returns -1.

Under GW-BASIC Version 3.20, the program also works correctly and
returns -1.

The following is a code example of this problem:

   lp:
   button= 0
   button = strig(1)
   print button
   goto lp

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.