file input #

Read a line from a file
stream, it reads string from the file referenced stream and returns it into data variable. The line feed is automatically removed.

file Input #stream , data

stream is a file previously opened by the open command.
data is the variable where string is saved to.

' open a text file
open "myfile.txt" for input as 1

' read until end of file
while not eof( 1 )
' read a line from the file and print it
file input  #1, data$ 
print data$
end while

' close the file
close( 1 )

See also file output # command.