ERDEV$ Returns Incorrect Value Under MS-DOS 5.0

ID: Q90396


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft BASIC Professional Development System (PDS) for MS-DOS, versions 7.0, 7.1
  • Microsoft QuickBASIC for MS-DOS, versions 4.0, 4.0b, 4.5
  • Microsoft MS-DOS operating system version 5.0


SYMPTOMS

The ERDEV$ function in Basic will return an incorrect value under MS-DOS version 5.0 for errors on the parallel ports LPT1 and LPT2. Instead of returning "LPT1:" when an error occurs on LPT1, ERDEV$ returns "M:", and with LPT2: it returns "T:".


STATUS

Microsoft has confirmed this to be a bug in the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS; in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 (buglist7.00 buglist7.10) for MS-DOS; in Microsoft QuickBasic version 4.5 (buglist4.50) for MS-DOS, while running Microsoft MS-DOS version 5.0. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

This problem does not occur under earlier versions of MS-DOS.


MORE INFORMATION

Steps to Reproduce Problem

  1. From the File menu, choose New Project.


  2. Copy the following code example into the Code window:
    
    ON ERROR GOTO handler
    LPRINT "Hello"
    END
    
    handler:
       PRINT ERDEV$
       END 


  3. Press the F5 to key run the program.



WORKAROUND

The only way to work around this problem is to explicitly keep track of what device your program is currently performing device I/O with, and use that as an indication of where the error occurred rather than rely on the ERDEV$ function.

Additional query words: VBmsdos QuickBas BasicCom 1.00 4.50 7.00 7.10 buglist1.00 buglist4.50 buglist7.00 buglist7.10

Keywords :
Version : MS-DOS:1.0,4.0,4.0b,4.5,5.0; :7.0,7.1
Platform : MS-DOS
Issue type :


Last Reviewed: December 10, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.