13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EOF functionFunctionSyntaxRemarksExampleEOF returns end-of-fHe status.y = EOF(filenum)filenum is the value specified when the fHe was OPENed.EOF returns TRUE (-1) if end-of-fHe has been reached on thespecified fHe; otherwise, FALSE (0) is returned.EOF is only valid for disk files opened for sequential input andfor communications fHes. An EOF return of -1 for a communicationsfHe means the buffer is empty.The following example reads information from sequential fHeTEXT.DTA until the end of the fHe is reached:OPEN "TEXT.OTA" FOR INPUT AS #1top:IF EOF(1) THENPRINT c "records (lines) in file TEXT.OTA"END IFINPUT #1, dummy$c = c + 1GOTO topor, stated more elegantly:OPEN "TEXT.OTA" FOR INPUT AS #1WHILE NOT EOF(l)INPUT #1, dummy$INCR cWENDPRINT c "records (lines) in file TEXT.OTA"END196<strong>Turbo</strong> <strong>Basic</strong> Owner's Handbook

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

Saved successfully!

Ooh no, something went wrong!