KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q62203: ADAPTER.BAS Needs SLEEP Statement When Compiled

Article: Q62203
Product(s): See article
Version(s): 7.00   | 7.00
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | SR# S900504-3 | mspl13_basic
Last Modified: 29-MAY-1990

The sample program APAPTER.BAS included with Microsoft BASIC
Professional Development System (PDS) version 7.00 must have the SLEEP
statement added to the code after the call to the SUBprogram so that
the message that states what video modes are supported on the monitor
is displayed when the program is compiled.

This information applies to Microsoft BASIC PDS 7.00 for MS-DOS and
OS/2.

ADAPTER.BAS works correctly when compiled, except that the message
displayed at the end of the program that states what video modes are
supported by the monitor is displayed and then erased. This is due to
the statement "SCREEN 0, 0", which sets the screen mode back to mode 0
following the test. This problem is related to the second parameter,
0, which is the "Color switch" parameter. When anything in the video
mode changes, the screen is erased. When the message is displayed in
the compiled program, the program ends and the screen mode is set back
to composite color monitor mode. A color switch parameter of 0 in the
SCREEN statement sets it to noncolor. By removing the color switch
parameter or setting it to 1, ADAPTER.BAS will work correctly.

ADAPTER.BAS works in the environment because the SCREEN mode is not
reset until you respond to the "Press any key to continue" message.
This can be demonstrated in the compiled program by placing a SLEEP
statement following the CALL to the SUBprogram Adapter and leaving the
SCREEN 0, 0 statement as is.

Code Example
------------

  -------ADAPTER.BAS-----------

  DECLARE SUB Adapter ()
  DEFINT A-Z
  Adapter
  SLEEP
  END

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.