begin
SYNTAX: begin statement1; statement2; .... end;
DESCRIPTION: "begin" is word-symbol (reserved word) in all Pascal standards. "begin" with its enclosing "end" groups together the statements between them so they are treated as one single statement during the execution. Wherever the Pascal syntax requires one statement "begin" ... "end" constructions can be used. (It is allowed to use empty statement: "begin end;".) The execution part of a program block syntactically is a single statement therefore should be enclosed into a "begin ... end." construction. This apply to the execution part of procedures and functions as well.
It is a syntax error having a "begin" without an enclosing "end".
STANDARDS: all
EXAMPLE: var ok:boolean; ... if not ok then begin writeln('Error occurred, execution aborted.'); halt; end;
SEE ALSO: end, for, while, do
_________________________
Comment this please.
miklos
According to Miklos Cserzo:
begin
Oha! 8-) You are really couragous!
SYNTAX: begin statement1; statement2; .... end;
DESCRIPTION: "begin" is word-symbol (reserved word) in all Pascal standards. "begin" with its enclosing "end" groups together the statements between them so they are treated as one single statement during the execution.
^^^^^^^^^^^^^^^^^^^^ This causes more confusion than good, IMO.
Wherever the Pascal syntax requires one statement "begin" ...
"one single"?
"end" constructions can be used. (It is allowed to use empty statement: "begin end;".) The execution part of a program block syntactically is a single statement therefore should be enclosed into a "begin ... end." construction.
This holds for the (optional) initialization part of Units as well.
This apply to the execution part of procedures and
applies
functions as well.
It is a syntax error having a "begin" without an enclosing "end".
Don't forget `to begin do' and `to end do' (already documented).
Peter