Procedures

Declaring

You can declare procedure like this:

procedure procedureName(parameterList); directives;
localDeclarations;
begin
statements
end;

where procedureName is any valid identifier, statements is a sequence of statements that execute when the procedure is called, and (parameterList), directives;, and localDeclarations; are optional.

Functions

Declaring

function functionName(parameterList): returnType; directives;

localDeclarations;
begin
statements
end;

where functionName is any valid identifier, returnType is any type, statements is a sequence of statements that execute when the function is called, and (parameterList), directives;, and localDeclarations; are optional.