bas7qck.hlp (Table of Contents; Topic list)
Passing Arguments
  Procedures                                   Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Passing Arguments
 
Procedure    Arguments     If Variable             If Expression
Type         Passed By     Argument                Argument
 
FUNCTION     Reference     Can change variable     Cannot change variable
SUB          Reference     Can change variable     Cannot change variable
DEF FN       Value         Cannot change variable  Cannot change variable
 
Passing by reference means that the address of each argument is passed
to the procedure by placing the address on the stack. Passing by value
means that the value of the argument, rather than the address, is passed
on the stack.
 
You can simulate a pass by value by using an expression in SUB call or
FUNCTION invocation:
 
Xcoordinate=Transform((A#))
 
Because (A#) is an expression, BASIC calculates its value, A#, and passes
the address of a temporary location containing the value. An address is
still passed, but because it is the address of a temporary location, the
action simulates a pass by value.