A function procedure is a sequence of ViviFire statements between the lines
The function procedure does a task, then returns control to the code that called it (known as the “caller”). The procedure returns a value to the caller.
Each time some code calls a procedure, its statements run, which starts with the first control statement after
Control usually continues until the line
But, it can be stopped by one of the statements
Exit Function or
You can make a function procedure in modules, classes, objects, and traits. Function procedures are private. They can be called only by other code in the same container (class, object, or trait), or module if not in one of these containers.
A function procedure can have arguments, for example, constants, variables, or expressions, passed to it by the caller.
Function function_name [ parameter_list ]
You declare the parameter list almost the same as you do for Sub Procedures.
To return a value
Example of declaration and call