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 />

INPUT# Statement<br />

Purpose:<br />

To read data items from a sequential file and assign them to program variables.<br />

Syntax:<br />

INPUT# file number, variable list<br />

Comments:<br />

file number is the number used when the file was opened for input.<br />

variable list contains the variable names to be assigned to the items in the file.<br />

The data items in the file appear just as they would if data were being typed on the keyboard in<br />

response to an INPUT statement.<br />

The variable type must match the type specified by the variable name.<br />

With INPUT#, no question mark is printed, as it is with INPUT.<br />

Numeric Values<br />

For numeric values, leading spaces and line feeds are ignored. The first character encountered<br />

(not a space or line feed) is assumed to be the start of a number. The number terminates on a<br />

space, carriage return, line feed, or comma.<br />

Strings<br />

If GW-BASIC is scanning the sequential data file for a string, leading spaces and line feeds are<br />

ignored.<br />

If the first character is a double quotation mark ("), the string will consist of all characters read<br />

between the first double quotation mark and the second. A quoted string may not contain a<br />

double quotation mark as a character. The second double quotation mark always terminates the<br />

string.<br />

If the first character of the string is not a double quotation mark, the string terminates on a<br />

comma, carriage return, line feed, or after 255 characters have been read.<br />

If end of the file is reached when a numeric or string item is being INPUT, the item is terminated.<br />

INPUT# can also be used with random files.<br />

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

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

Saved successfully!

Ooh no, something went wrong!