next up previous contents index search.gif
Next: 8.2 Function declaration Up: 8. Using functions and Previous: 8. Using functions and

8.1 Procedure declaration

A procedure declaration defines an identifier and associates it with a block of code. The procedure can then be called with a procedure statement.

Procedure declaration

\begin{syntdiag}\setlength {\sdmidskip}{.5em}\sffamily\sloppy \synt{procedure\ d...
...
\synt{procedure\ header} \lit* ;
\synt{subroutine\ block} \lit *;\end{syntdiag}

\begin{syntdiag}\setlength {\sdmidskip}{.5em}\sffamily\sloppy \synt{procedure\ h...
...meter\ list}
\begin{displaymath}\synt{modifiers} \end{displaymath}\end{syntdiag}

\begin{syntdiag}\setlength {\sdmidskip}{.5em}\sffamily\sloppy \synt{subroutine\ ...
...ynt{external\ directive}\\
\synt{asm\ block}\\
\lit*{forward}
\)\end{syntdiag}
section Parameters for the list of parameters. A procedure declaration that is followed by a block implements the action of the procedure in that block. The following is a valid procedure :

Procedure DoSomething (Para : String);
begin
  Writeln ('Got parameter : ',Para);
  Writeln ('Parameter in upper case : ',Upper(Para));
end;
Note that it is possible that a procedure calls itself.

root
1999-06-10