17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

LINE INPUT Statement<br />

Purpose:<br />

To input an entire line (up to 255 characters) from the keyboard into a string variable, ignoring<br />

delimiters.<br />

Syntax:<br />

LINE INPUT [;][prompt string;]string variable<br />

Comments:<br />

prompt string is a string literal, displayed on the screen, that allows user input during<br />

program execution.<br />

A question mark is not printed unless it is part of prompt string.<br />

string variable accepts all input from the end of the prompt to the carriage return. Trailing<br />

blanks are ignored.<br />

LINE INPUT is almost the same as the INPUT statement, except that it accepts special characters<br />

(such as commas) in operator input during program execution.<br />

If a line-feed/carriage return sequence (this order only) is encountered, both characters are input<br />

and echoed. Data input continues.<br />

If LINE INPUT is immediately followed by a semicolon, pressing the RETURN key will not move<br />

the cursor to the next line.<br />

A LINE INPUT may be escaped by typing CTRL-BREAK. GW-BASIC returns to command level<br />

and displays Ok.<br />

Typing CONT resumes execution at the LINE INPUT line.<br />

Example:<br />

100 LINE INPUT A$<br />

Program execution pauses at line 100, and all keyboard characters typed thereafter are input to<br />

string A$ until RETURN, CTRL-M, CTRL-C, or CTRL-BREAK is entered.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/LINEINPUT.html28/03/2004 21.29.35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!