05-21-2025, 12:11 PM
Example showing difference passing parameter variables by reference or by value:
Code: (Select All)
x = 5: x$ = "ABC"
Print "By Reference:"
Print "Checkfunction returns "; CheckFunction$(x, x$)
Print "After CheckFunction x="; x
Print "After CheckFunction x$="; x$
x = 5: x$ = "ABC"
Print "By Value:"
Print "Checkfunction returns "; CheckFunction$((x), "a" + x$)
Print "After CheckFunction x="; x
Print "After CheckFunction x$="; x$
Function CheckFunction$ (x, x$)
x = x * 3: x$ = x$ + "DEF"
CheckFunction$ = "hello"
End Function
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience

