Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

Basic Pascal Tutorial/Chapter 2/EOLN and EOF

Deutsch · English · Français · Български · 中文(中国) · 日本語

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.

pascal
eoln (file_variable)

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.

pascal
eoln

EOF is a Boolean function that is TRUE when you have reached the end of the file.

pascal
eof (file_variable)

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.


From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 2/EOLN and EOF", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .