FUNCTION name (parameter list) [AS INTEGER | AS
STRING]
parameter list = parameter [, parameter list]
parameter = [BYVAL] paramname [AS
INTEGER]
| [BYVAL] paramname(size) AS
STRING
| BYREF paramname AS STRING
Used as a modifier in parameter declarations for FUNCTIONs or SUBs.
When used a pointer to the parameter will be used in the FUNCTION or SUB. This allows a function to read AND write the original source parameter.
An advantage in use with STRINGs, is that extra space is not required and the STRING does not have to be copied for the FUNCTION or SUB procedure. Constant strings may be passed BYREF, but any code that attempts to modify a constant string will cause a Data Abort.