Microsoft KB Archive/65194

= &quot;Redo from Start&quot; for Correct INPUT in QB and Basic PDS =

Article ID: 65194

Article Last Modified on 11/21/2006



This article was previously published under Q65194



SYMPTOMS
Normally, the INPUT statement correctly gives a &quot;Redo from start&quot; message if you mistakenly type a string as input when a number is expected. However, the INPUT statement incorrectly gives the error message &quot;Redo from start&quot; when all of the following conditions coincide:


 * 1) The program is using the INPUT &quot;prompt&quot;, form of the INPUT statement.
 * 2) The variable being INPUT is a single-precision element of a $DYNAMIC array.
 * 3) The program does NOT contain error trapping, was NOT compiled with BC /X, and does NOT have line numbers.

The INPUT statement will also incorrectly display a question mark (?) prompt under the above conditions. The problem occurs in executable (.EXE) programs compiled with BC.EXE, but does not occur in the QB.EXE or QBX.EXE environment.



STATUS
Microsoft has confirmed this to be a bug in QuickBasic versions 4.00, 4.00b, and 4.50 (buglist4.00, buglist4.00b, buglist4.50); with Microsoft Basic Compiler versions 6.00 and 6.00b; and with Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
This problem can be easily worked around in any one of the following ways:

 Compile the program with BC /X. Include ON ERROR GOTO error-trapping in the program. Include a line number on the line where the INPUT occurs.  Use the following format to prompt the user: PRINT &quot;prompt message&quot;; INPUT &quot;&quot;,  Use a static array instead of a dynamic array.

Code Example:
The example below demonstrates this problem. Compile and link the program as follows: BC INPUT.BAS ; LINK INPUT ; When you run this program and correctly enter a number (such as 3.21 or 0) or press ENTER alone, the program incorrectly gives a &quot;Redo from start&quot; message. You must press CTRL+C or CTRL+BREAK to stop the program. ' $DYNAMIC DIM z(4) i% = 1 z(i%) = 0 INPUT &quot;Input a real number: &quot;, z(i%) END

Additional query words: QuickBas BasicCom buglist6.00 buglist6.00b buglist7.00 buglist7.10

Keywords: KB65194

-

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

© Microsoft Corporation. All rights reserved.