Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
INPUT, LINE INPUT Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
[LINE] INPUT [;] ["prompt"{; | ,}] stringvariable$
Usage Notes
■ References to the INPUT or LINE INPUT statement are not allowed with
forms and cause Visual Basic to generate the error message, "Not
available when forms are showing."
■ To use the INPUT or LINE INPUT statement with forms, you must first
unload or hide any visible forms. See: ◄HIDE Method► ◄UNLOAD Statement►
■ If the user is inputting only decimal integers, you can save between
1.6K and 11K in a non-stand-alone .EXE file by linking with the stub
file NOFLTIN.OBJ. This places the following restrictions on user input:
• Decimal numbers only (no leading &H, &O, or &base specifiers)
• No trailing type specifiers (%, &, !, #, @, and $)
• No decimal point, E, or D (for example, 1.E2 cannot be used in place
of the integer 100)
■ If the user is limited to using the Enter and Backspace keys for
editing, you can reduce the size of the .EXE file by linking the stub
file NOEDIT.OBJ.
■ The INPUT statement causes a running program to pause and wait for the
user to enter data from the keyboard. The number and type of data items
required from the user is determined by the structure of variablelist.
■ The number of entered data items must be the same as the number of
variables in the list. The type of each entered data item must agree
with the type of the variable. If either of these rules is violated, the
program displays the prompt, "Redo from start" and input values are not
assigned.
■ The INPUT statement determines the number of entered data items in a
multiple-item list as follows:
• The first character encountered after a comma that is not a space,
carriage return, or linefeed is assumed to be the start of a new item.
• If this first character is a quotation mark ("), the item is typed as
string data and consists of all characters between the first quotation
mark and the second.
• Not all strings have to start with a quotation mark. If the first
character of the string is not a quotation mark, it terminates on a
comma, carriage return, or linefeed.
■ Input stored in a record must be entered as single elements. For
example:
TYPE Demograph
FullName AS STRING * 25
Age AS INTEGER
END TYPE
DIM Person AS Demograph
INPUT "Enter name and age: "; Person.FullName, Person.Age
■ You can suggest to the user various ways to edit a line of input before
pressing Enter to submit the line to the program. The following key
combinations move the cursor, delete text, and insert text on the input
line:
Keystrokes Edit Function
════════════════════ ═══════════════════════════════════════════
Ctrl+M or Enter Store input line
Ctrl+H or Backspace Delete character to the left of the cursor,
unless cursor is at the beginning of the
input, in which case delete character at the
cursor
Ctrl+\ or Right Arrow Move cursor one character to the right
Ctrl+] or Left Arrow Move cursor one character to the left
Ctrl+F or
Ctrl+Right Arrow Move cursor one word to the right
Ctrl+B or
Ctrl+Left Arrow Move cursor one word to the left
Ctrl+K or Home Move cursor to beginning of input line
Ctrl+N or End Move cursor to end of input line
Ctrl+R or Ins Toggle insert mode on and off
Ctrl+I or Tab Tab right and insert (insert mode on), or
tab right and overwrite (insert mode off)
Del Delete character at the cursor
Ctrl+E or Ctrl+End Delete to end of the line
Ctrl+U or Esc Delete entire line, regardless of cursor
position
Ctrl+T Toggle function-key label display on and off
at bottom of screen
Ctrl+C or Ctrl+Break Terminate input (exit compiled program)
───────────────────────────────────────────────────────────────────
■ When you use INPUT with ISAM programs, Visual Basic performs a
CHECKPOINT operation every 20 seconds during an INPUT polling loop.
A CHECKPOINT writes open database buffers to disk.