<<

Contents

Search

>>

 

INPUT$

 

 

Function

 

 

Syntax:

INPUT$(<Number of Characters>[,<File Number>])

 

<Number of Characters>

= <NUM-EXPRESSION>

<File Number>

= <NUM-EXPRESSION>

 

 

Meaning:

Reads <Number of Characters> characters from a file.

 

If the file end is reached while reading, the string is shorter than <Number of Characters> and only contains the read characters. Whether the file end has been reached must be ascertained with the function EOF .

 

If the parameter <File Number> is missing, the characters are read from the keyboard.

 

Parameter:

Number of Characters

Number of characters to read

File Number

Number of file

 

Sample:

OPEN INPUT,2,"XYZ" ERROR .. Error ... END

IF NOT EOF(2)

THEN H$ = INPUT$(10,2)

ELSE ERRORMES = "End of file!"

ENDIF

 

See also:

INPUT

LINE INPUT

EOF

OPEN

OUTPUT

CLOSE