Basic Pascal Tutorial/Chapter 2/EOLN and EOF: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Basic Pascal Tutorial/Chapter 2/EOLN and EOF
| Old | New | Line | |
|---|---|---|---|
| 1 | + | 2E - EOLN and EOF (author: Tao Yue, state: unchanged) | |
| 2 | + | ||
| 3 | + | `EOLN` is a Boolean function that is `TRUE` when you have reached the end of a line in an open input file. | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | eoln (file_variable) | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | 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. | |
| 10 | + | ||
| 11 | + | ``` pascal | |
| 12 | + | eoln | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | `EOF` is a Boolean function that is `TRUE` when you have reached the end of the file. | |
| 16 | + | ||
| 17 | + | ``` pascal | |
| 18 | + | eof (file_variable) | |
| 19 | + | ``` | |
| 20 | + | ||
| 21 | + | 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`. | |
| 22 | + | ||
| 23 | + | --- | |
| 24 | + | *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](/wiki-contact).* |
