Go to the first, previous, next, last section, table of contents.

Procedure Types

If a result-type for the procedure is specified, then the procedure must return a value of that type using a RETURN statement.

If a constant-expression is supplied as a default value for a formal-parameter, the type for the parameter may be omitted. When the procedure is called, if an argument is not supplied for a formal parameter with a default value, the default value is used instead

The RAISES section specifies which exceptions the procedure may raise. Any exceptions that occur in the procedure---possibly as the result of a call to another procedure---that are not handled by the procedure and that do not appear in the RAISES clause cause a checked run-time error. If the RAISES section is omitted, then any exceptions raised cause a checked run-time error.

The VAR, VALUE, and READONLY parameter modes determine how the actual argument is associated with the formal parameter:

VALUE

This is the default mode, and means "call by value." The formal parameter contains a copy of the value of the actual argument. Changes to the formal parameter do not affect the actual argument.

VAR

This means "call by reference." The formal parameter is linked to the actual argument. Changes to the formal parameter are reflected in the actual argument. In general, the actual argument must be a variable. No default value may be specified.

READONLY


Example

Here we declare a new procedure type Handler which use used by the RegisterHandler routine.


Go to the first, previous, next, last section, table of contents.