Chapter 4 Further Reading
Official Documentation
-
Free Pascal Reference Guide: Input/Output — The authoritative reference for
Read,ReadLn,Write,WriteLn, and formatting specifiers in Free Pascal. Available at https://www.freepascal.org/docs-html/ref/refch13.html. -
Free Pascal RTL Reference: System Unit — Documents the
Val,Str,Write,WriteLn,Read, andReadLnprocedures in the default System unit. See https://www.freepascal.org/docs-html/rtl/system/. -
Free Pascal RTL Reference: CRT Unit — Full documentation for the CRT unit including
ClrScr,GotoXY,TextColor,TextBackground,KeyPressed, andReadKey. See https://www.freepascal.org/docs-html/rtl/crt/.
Books
-
Jensen, K. and Wirth, N. Pascal User Manual and Report (4th edition, Springer, 1991). Wirth's own specification of standard Pascal, including the original definition of
Read,Write, and their line-oriented counterparts. The formatting rules in Section 12 are the foundation for everything in this chapter. -
Cantu, Marco. Object Pascal Handbook (latest edition). Chapter 2 covers basic I/O in Delphi's Object Pascal dialect. Useful for seeing how the same concepts apply in a modern commercial Pascal environment.
-
Duntemann, Jeff. Assembly Language Step-by-Step (3rd edition, Wiley, 2009). While not a Pascal book, Duntemann's explanation of how standard output actually reaches the screen — system calls, file descriptors, terminal drivers — provides valuable context for understanding what
WriteLnis really doing at the machine level.
Historical Context
-
Wirth, N. "The Programming Language Pascal" (Acta Informatica, 1971). The original paper introducing Pascal. Section 11 defines the I/O procedures. Remarkably, the
Write/WriteLnsyntax and formatting rules have remained almost unchanged for over fifty years — a testament to Wirth's design. -
Borland. Turbo Pascal 7.0 Language Guide (1992). Documents the
CRTunit andValprocedure as Borland defined them. Free Pascal's implementations are direct descendants of these specifications.
Online Resources
-
Free Pascal Wiki: Console Programming — Practical guide to building console applications with Free Pascal, including tips on cross-platform terminal handling. See https://wiki.freepascal.org/.
-
Lazarus Forum: Console I/O FAQ — Community-maintained FAQ addressing common questions about
Read/ReadLnbehavior, input buffer issues, and character encoding in Free Pascal console programs. See https://forum.lazarus-ide.org/.
For the Curious
-
Kernighan, Brian. "Why Pascal Is Not My Favorite Programming Language" (1981). A famous critique by one of C's creators. Section 5 specifically criticizes Pascal's I/O system as too rigid compared to C's
printf/scanf. Reading this alongside our chapter provides useful perspective: Kernighan's complaints were valid for 1981 Standard Pascal but have been largely addressed by Free Pascal's extensions (theFormatfunction,SysUtilsstring utilities, and flexibleValprocedure). -
Dijkstra, Edsger. "On the Foolishness of Natural Language Programming" (EWD 667, 1978). Dijkstra argues that programming languages should be precise, not conversational. Pascal's I/O design reflects this philosophy: you must specify exactly what you want to read and how you want it displayed. There is no guessing, no automatic formatting, no implicit conversion — everything is explicit.
Looking Ahead
- Chapter 5 builds on the input techniques from this chapter to create programs that make decisions based on user input.
- Chapter 6 introduces loops, which will eliminate the repetitive code in our PennyWise checkpoint and allow us to read any number of expenses.
- Chapter 13 extends I/O from the console to files, where the
Read/ReadLndistinction and the{$I-}/IOResultmechanism become essential tools.