LINE INPUT statement

Purpose

Read an entire line from the keyboard into a string variable, ignoring delimiters.

Syntax

LINE INPUT ["prompt" | $string_equate] [,] string_variable

Remarks

prompt is an optional string constant or a string equate.  LINE INPUT displays prompt on the screen and waits for user input.  Keystrokes are accepted until you press ENTER, at which time the resulting string is loaded into string_variable.

string_variable may be a fixed-length, ASCIIZ, or dynamic string.  For fixed-length and ASCIIZ strings, keyboard input that is longer than the string is truncated to fit into the string.  Dynamic strings receive the complete keyboard input without truncation.  string_variable may not be a UDT variable, although fixed-length and ASCIIZ UDT member variables are supported.

Restrictions

This statement always returns keyboard input; it is not subject to input redirection.  LINE INPUT can now accept up to 9999 characters.  LINE INPUT previously accepted only up to 128 characters.

See also

INKEY$, INSTAT, LINE INPUT#, WAITKEY$

Example

LINE INPUT "Please enter your name: " a$

PRINT "Hello "; a$