Method Procedures

A method procedure is a sequence of ViviFire statements between the lines Method and End.

The Method procedure does a task, then returns control to the calling code (known as the "caller"). When it returns, the procedure returns a value to the caller.

Each time code calls the procedure, its statements execute. Execution starts with the first executable statement after the line Method. Execution usually continues until the line End. But one of two statements can stop it: Exit Method or Return.

You can make method procedures in modules, classes, objects, and traits. It is public, thus it can be called from all other code.

A method procedure can use arguments, for example, constants, variables, or expressions, which the caller passes to it.

Declaration syntax

The usual syntax for a Method procedure follows:

[ modifier ] Method method_name [ parameter_list ]
    ' statements
End Method

The modifier lets you know if the method is abstract or open. See Method Statement for more information.

You declare the parameter list the same as you do for Sub Procedures.

See also