Basic Pascal Tutorial/Chapter 2/EOLN and EOF

From Free Pascal wiki
Revision as of 15:21, 5 January 2010 by Kees (talk | contribs)
Jump to navigationJump to search

2E - EOLN and EOF (author: Tao Yue, state: unchanged)

EOLN is a Boolean function that is TRUE when you have reached the end of a line in an open input file. <delphi> eoln (file_variable) </delphi>

If you want to test to see if the standard input (the keyboard) is at an end-of-line, simply issue eoln without any parameters. This is similar to the way in which read and write use the console (keyboard and screen) if called without a file parameter. <delphi> eoln </delphi>

EOF is a Boolean function that is TRUE when you have reached the end of the file. <delphi> eof (file_variable) </delphi>

Usually, you don't type the end-of-file character from the keyboard. On DOS/Windows machines, the character is Control-Z. On UNIX/Linux machines, the character is Control-D.

previous contents next