Microsoft KB Archive/90396

= ERDEV$ Returns Incorrect Value Under MS-DOS 5.0 =

Article ID: 90396

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1
 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft MS-DOS 5.0 Standard Edition

-



This article was previously published under Q90396



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 &quot;LPT1:&quot; when an error occurs on LPT1, ERDEV$ returns &quot;M:&quot;, and with LPT2: it returns &quot;T:&quot;.



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.



Steps to Reproduce Problem
 From the File menu, choose New Project.  Copy the following code example into the Code window: ON ERROR GOTO handler LPRINT &quot;Hello&quot; END

handler: PRINT ERDEV$ END  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: KB90396

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.