Microsoft KB Archive/30402

= INPUT Receives Nonzero Value When &quot;&&quot; Character Is Input =

Article ID: 30402

Article Last Modified on 11/21/2006



This article was previously published under Q30402



SYMPTOMS
When you INPUT the ampersand (&) character into a numeric variable, the value input is nonzero. This result occurs 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.

Receiving the ampersand character in an INPUT statement should return zero, because the ampersand character denotes a long-integer constant. However, this character does not return zero.



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
In the QB.EXE environment, a value of 203 is received when the ampersand character is INPUT. When running the same program from an EXE file, the value 233 is received. In an EXE program compiled with Microsoft Basic Compiler Versions 6.00 and 6.00b, the value 259 is received.

The INPUT statement correctly inputs a zero into a numeric variable when you input the ampersand character in QuickBasic Version 3.00, or in Basic PDS 7.00.

The following is a code example: INPUT &quot;Enter an integer : &quot;, I%    ' Type in &amp; character. PRINT I%

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

Keywords: KB30402

-

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

© Microsoft Corporation. All rights reserved.