Method Procedures

A method procedure is a sequence of ViviFire statements between the lines Method and End. The procedure does a task, then returns control to the code that called it, also known as the “caller”). The procedure can return a value to the caller.

Each time code calls the procedure, its statements run. It starts with the initial statement after Method and usually continues until End (or End Method). But one of two statements can stop it: Exit Method or Return.

You can make method procedures in libraries, classes, objects, and traits. It has public member access, thus it can be called from all other code.

A method procedure can have arguments (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