>If I want to send 2 variables by value and return 2 variables by reference how would i do that.
>
You would pass 4 parameters to the function call, two by reference. A simple example. Parms passed by reference can be both in and out variables, so it might only need two or three. FWIW, I use parameter objects rather than pass by ref updates; objects result in simpler interfaces, and typically, when I have several values to return, they probably are related. I use pass by reference mainly for sending arrays to my functions, and for recursion.
LOCAL Var1, Var2, Var3, Var4
STORE 'Init' TO Var1, Var2, Var3, Var4
? 'Start',Var1,Var2,Var3,Var4
=DemoPass(Var1,@Var2,Var3,@Var4) && parms 2 and 4 pass by ref
? 'After 1st call',Var1,Var2,Var3,Var4 && Var4 changed by function
=DemoPass(Var1,Var2,@Var3,@Var4) && parms 3 and 4 pass by ref
? 'After 2nd call',Var1,Var2,Var3,Var4 && both Var3 and Var4 changed by function
FUNCTION DemoPass
LPARAMETERS Parm1, Parm2, Parm3, Parm4
* Alter the values of the 3rd and 4th parm to demo pass by ref
Parm3 = 'New' + Parm3
Parm4 = 'New' + Parm4
RETURN