Passing Arguments by Value and by Reference

In ViviFire, you can pass an argument to a procedure by value or by reference. This is known as the passing mechanism. It controls if the procedure can change the object that is the argument passed by the caller. The procedure declaration controls the passing mechanism for each parameter with the keyword ByRef.

Qualities of arguments and parameters

When you pass an argument to a procedure, know the many related qualities.

Selection of passing mechanism

Select the passing mechanism carefully for each argument.

Protection
TODO
Performance
TODO

Control the passing mechanism

The procedure's declaration controls the passing mechanism for each parameter. The caller cannot override the passing mechanism “by value”.

If a parameter is declared with ByRef, then the caller can call by value if you write the argument between parentheses.

The default passing mechanism in ViviFire is by value.

When to pass by value

TODO

When to pass by reference

TODO

Example

TODO

See also