The reason your initial code passes by value to the sub is the use of double brackets
Call MySub(a) ' passes reference to a
Call MySub((a)) ' evaluates (a) to tempvalue and passes reference to tempvalue
(Same is true for Functions btw)
btw i prefer to write (and read):
MySub a 'byref
MySub (a) 'byval
Call MySub(a) ' passes reference to a
Call MySub((a)) ' evaluates (a) to tempvalue and passes reference to tempvalue
(Same is true for Functions btw)
btw i prefer to write (and read):
MySub a 'byref
MySub (a) 'byval
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience