Microsoft KB Archive/28980

= &quot;NUL&quot; Device Behaves Different in QB 4.x than 3.00 or GWBasic =

Article ID: 28980

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b

-



This article was previously published under Q28980



SYMPTOMS
The NUL device in QuickBasic Versions 4.00, 4.00b, and 4.50 behaves differently than in previous versions of QuickBasic (or in GW-Basic 3.20).



STATUS
Microsoft has confirmed this to be a bug in QuickBasic Versions 4.00, 4.00b, and 4.50, and in Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2 (buglist6.00, buglist6.00b). This problem was corrected in Microsoft Basic Professional Development System (PDS) Version 7.00 for MS-DOS and MS OS/2 (fixlist7.00).



MORE INFORMATION
When the program below is run (either inside the QB.EXE editor or from an executable .EXE program), the (incorrect) output is as follows:   third When run inside the QuickBasic Version 3.00 editor or compiled to an EXE file with QB.EXE Version 3.00, or run in GW-Basic Interpreter Version 3.20, the (correct) output is as follows:   first secondthird With Version 4.00, the string BUFFER$ appears to be reinitialized with each PRINT #1 statement.

If the device name is changed from NUL to anything else, for example TMP, QuickBasic Versions 3.00 and 4.00 produce the same (correct) output.

The following is a code example for this problem: open &quot;nul&quot; for random as #1 field #1, 65 as buffer$ print#1,&quot;first&quot; print#1,&quot;second&quot;; print #1,&quot;third&quot; print buffer$

Additional query words: QuickBas BasicCom B_BasicCom buglist4.00 buglist4.00b buglist4.50

Keywords: KB28980

-

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

© Microsoft Corporation. All rights reserved.