Procedure statements execute procedures (which may involve passing actual parameters to the procedures formal parameters). Procedure statements are executed as follows:
writeln('1 + 1 = ', 1+1)
is a simple example. When this procedure statement is executed the actual parameters
'1 + 1 = '
and
1+1
are passed to the procedure and then the procedure prints the actual parameters to the file associated with output.
(NOTE: for clarity some parts of the syntax are omitted, see Irie Pascal Grammar for the full syntax):
procedure-statement = procedure-identifier (
[ actual-parameter-list ] |
read-parameter-list | readln-parameter-list |
write-parameter-list | writeln-parameter-list
)
actual-parameter = expression | variable-access |
procedure-identifier | function-identifier
actual-parameter-list = '(' actual-parameter { ',' actual-parameter } ')'
function-identifier = identifier
procedure-identifier = identifier
read-parameter-list = '(' [ file-variable ',' ] variable-access { ',' variable-access } ')'
readln-parameter-list = [ '(' ( file-variable | variable-access ) { ',' variable-access } ')' ]
write-parameter = expression [ ':' expression [ ':' expression ] ]
write-parameter-list = '(' [ file-variable ',' ] write-parameter { ',' write-parameter } ')'
writeln-parameter-list = [ '(' ( file-variable | write-parameter ) { ',' write-parameter } ')' ]