PROLOG PROCEDURE Declaration

<prolog procedure declaration>

── PROLOG PROCEDURE ──<identifier>── ; ──<unlabeled statement>─────────┤

The PROLOG PROCEDURE declaration can only be declared inside a STRUCTURE or CONNECTION BLOCK TYPE declaration. The PROLOG PROCEDURE declaration allows you to designate a procedure that must be executed when the structure or connection block instance is first created. If a PROLOG PROCEDURE declaration exists for a structure or connection block, the prolog procedure is executed automatically by the operating system when the structure or connection block instance (structure block variable, structure block array element, or connection) is first touched. You can also invoke the prolog procedure directly.

The following restrictions apply to PROLOG PROCEDURE declarations:

  • No parameters are allowed.

  • A prolog procedure cannot return a value.

  • The body of a prolog procedure can contain a compound statement only. The prolog procedure body cannot be declared as external, as a library entry point specification, or as a dynamic procedure specification.

  • A prolog procedure cannot be declared as a formal parameter. However, a prolog procedure can be passed as an actual parameter if the formal parameter is an untyped procedure without parameters.

Identifiers

<prolog procedure identifier>

An identifier that is associated with a prolog procedure in a PROLOG PROCEDURE declaration.