Function functionName(byref var1, byref var2$...)

Variables passed as arguments into functions and subs are passed "by value" by default, which means that a copy of the variable is passed into the function or sub.  The value of the variable is not changed in the main program if it is changed in the function.  A variable may instead by passed "byref" which means that a reference to the actual variable is passed and a change in the value of this variable in the function or sub changes the value of the variable in the main program.

Example:
function formatAndTruncateXandY$(byref a, byref b)
    a = int(a)
    b = int(b)
    formatAndTruncateXandY$ = str$(a)+", "+str$(b)
end function

sub capitalize byref word$
    word$ = upper$(left$(word$, 1))+mid$(word$, 2)
end sub




