Input loop is part of Short Circuit's Console Program Basics selection.
Task

Read from a text stream either word-by-word or line-by-line until the stream runs out of data.

The stream will have an unknown amount of data on it.




If OpenConsole()
  ; file based line wise
  If ReadFile(0, "Text.txt")  
    While Eof(0) = 0          
      Debug ReadString(0)      ; each line until eof
    Wend
    CloseFile(0)               
  EndIf
 
  ; file based byte wise
  If ReadFile(1, "Text.bin")  
    While Eof(1) = 0          
      Debug ReadByte(1)      ; each byte until eof
    Wend
    CloseFile(1)               
  EndIf
EndIf