Microsoft KB Archive/51322

= Basic INPUT and LINE INPUT Always Turn on Cursor during Input =

Article ID: 51322

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 1.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 1.01, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 1.02, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 2.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 2.01, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 3.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBASIC 4.0b, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.5 for MS-DOS, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft GW-BASIC 3.2, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft GW-BASIC 3.22, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft GW-BASIC 3.23, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition

-



This article was previously published under Q51322



SUMMARY
The INPUT and LINE INPUT statements always turn on the cursor when they are executed. Turning off the cursor beforehand with the LOCATE statement will not turn off the INPUT or LINE INPUT cursor. If the LOCATE statement turned off the cursor before the INPUT or LINE INPUT statement, the cursor will be off after input is completed. But during execution of INPUT or LINE INPUT, the cursor remains on.

This information applies to Microsoft QuickBasic Versions 1.00, 1.01, 1.02, 2.00, 2.01, 3.00, 4.00, 4.00b, and 4.50 for MS-DOS, Microsoft Basic Compiler Versions 6.00, and 6.00b for MS-DOS and MS OS/2, Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2, and to Microsoft GW-Basic Interpreter Versions 3.20, 3.22, and 3.23 for MS-DOS.



MORE INFORMATION
If you want a form of input that has no automatic cursor, you can invoke the LOCATE statement to turn off the cursor and use the INKEY$ function in a loop to accept input character by character. For an example of using INKEY$ to input a fixed number of characters in a loop, query on the following words:

buffered and INKEY$ and keyboard and INPUT and LOCATE

The following code example demonstrates the visibility of the cursor when using the INPUT statement. The results are the same for the LINE INPUT statement.

Code Example
LOCATE 1,1,0        'Turn cursor off INPUT a$            'Cursor will come back on PRINT a$             'Cursor will be off again while inkey$=&quot;&quot; : wend  ' Wait for any keystroke.

Additional query words: QuickBas BasicCom

Keywords: KB51322

-

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

© Microsoft Corporation. All rights reserved.