Revision 2 of 3, by WikiArchive on 11-4-2026. The page as it is now.
Begin
The reserved word begin marks the start of the definition of the executable portion of a block. In conjunction with end it is also used to group statements into a so-called “compound statement”.
Note: In Pascal a compound statement does not create a new scope. Only blocks do.
In extended Pascal to begin do … starts the definition of the initialization part of a module.
While every begin must have a corresponding end, not all occurrences of end have a corresponding begin.
syntax justification
Lots of programming languages use a pair of single characters to indicate boundaries. Typing out the words begin and end is indeed more cumbersome than writing { }. However, the meaning of such characters is not as obvious as words are.
matching
- The source editor of the Lazarus IDE supports a “find matching begin/end” function.
- vim can be configured to support matching Pascal’s
begin/end, too.
Keywords: begin — do — else — end — for — if — repeat — then — until — while
From the Free Pascal wiki, page "Begin", as the Internet Archive kept it on 2022-11-28. 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.
