KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q32214: "Device I/O" Error Using LPRINT or "LPT1:" After a CHAIN

Article: Q32214
Product(s): See article
Version(s): 6.00 6.00b 7.00
Operating System(s): OS/2
Keyword(s): ENDUSER | buglist6.00 buglist6.00b buglist7.00 | mspl13_basic
Last Modified: 17-JAN-1990

The following problem occurs in OS/2 protected mode programs compiled
with Microsoft BASIC Compiler Versions 6.00 and 6.00b or Microsoft
BASIC Professional Development System (PDS) Version 7.00 for MS OS/2.
Using LPRINT, or sending output to the "LPT1:" device name, then
chaining to a second routine that uses the printer produces the
following error:

   Device I/O error in line 0 of module PROG2

This problem can be worked around in OS/2 protected mode by sending
output to the DOS "LPT1" (without a colon) device name instead of
using LPRINT or "LPT1:". This problem does not occur in OS/2 real
mode.

Microsoft has confirmed this to be a problem in Microsoft BASIC
Compiler Versions 6.00 and 6.00b and in Microsoft BASIC PDS Version
7.00. We are researching this problem and will post new information
here as it becomes available.

The following chained programs demonstrate the "Device I/O" error.
These programs must be compiled with the BRUN library option for
protected mode.

   ' prog1
   OPEN "O",15,"LPT1:"
   PRINT #15,"program 1"
   CHAIN "prog2"

   ' prog2
   PRINT #15,"program 2"
   CLOSE #15

The problem occurs only when sending output to the BASIC "LPT1:"
printer device. If the DOS device, "LPT1" (without a colon) is used,
the problem does not occur. For example, the following programs CHAIN
correctly:

   ' prog1
   OPEN "O",15,"LPT1"
   PRINT #15,"program 1"
   CHAIN "prog2"

   ' prog2
   PRINT #15,"program 2"
   CLOSE #15
   SYSTEM

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.