A procedure is a block of ViviFire statements between a declaration clause (Function, Method, Property, Sub) and an end clause (End). Almost all executable statements must be in a procedure. A module (Program) can contain executable statements also. But we recommend a procedure for a program that is larger than an example.

Calling a procedure

You execute a procedure from a different area of the code. This is known as a procedure call. When the procedure completes, it moves control back to the code that executed it, also known as the caller. The caller is a statement (or an expression in a statement) that refers to the procedure by its name and moves control to it.

Returning from a procedure

A procedure gives back control to the caller when it is done. It can use one of the statements Return or Exit, or let it execute until the clause End. Then control moves to the caller after the point of the procedure call.

Parameters and arguments


Types of procedures

Procedures and structured code


See also