# LINE INPUT

LINE INPUT Variable

Reads an entire line of text on the standard input.

LINE INPUT # File , Variable

Same as above, except that the data are read from the stream File.

Example

    ' Print a file to standard output

    OPEN FileName FOR READ AS #hFile

    WHILE NOT Eof(hFile)
      LINE INPUT #hFile, OneLine
    PRINT OneLine

    WEND

    CLOSE #hFile

Tip: Do not use LINE INPUT to read from binary files, because you will lose the linefeed characters. Use READ instead:

    READ #hFile, OneLine, -256

where "-256" is the maximum number of bytes you want with a minus sign in front of it.

See also

CLOSE, COPY, Eof, FLUSH, INPUT, Lof, KILL, OPEN, PRINT, READ, RENAME, Seek, SEEK, WRITE

Previous: LIKE Next: Local variable declaration