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 run.
It starts to run code with the first statement after the line Method
.
It usually continues until the line End
.
But one of two statements can stop it: Exit Method
or Return
.
You can make method procedures in libraries, 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.