Basic INPUT and LINE INPUT Always Turn on Cursor during Input (51322)



The information in this article applies to:

  • Microsoft QuickBASIC 1.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 1.01, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 1.02, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 2.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 2.01, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 3.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.0b, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.5, when used with:
    • the operating system: MS-DOS
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft GW-BASIC 3.2, when used with:
    • the operating system: MS-DOS
  • Microsoft GW-BASIC 3.22, when used with:
    • the operating system: MS-DOS
  • Microsoft GW-BASIC 3.23, when used with:
    • the operating system: MS-DOS

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$="" : wend   ' Wait for any keystroke.

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:KB51322