The requested feature is specified in the codes.
Code: Select all
Define a,b,c = 1,2,3
Code: Select all
Global a,b,c = 1,2,3
Code: Select all
Protected a,b,c = 1,2,3
.
.
Code: Select all
Define a,b,c = 1,2,3
Code: Select all
Global a,b,c = 1,2,3
Code: Select all
Protected a,b,c = 1,2,3
Code: Select all
Define a=1,b=2,c=3
Global a=1,b=2,c=3
Protected a=1,b=2,c=3
Code: Select all
Procedure MultiRet(a,b,c)
ProcedureReturn a,b,c
EndProcedure
Global a,b,c = MultiRet(10,20,30)
I tried passing an address as an argument and it didn't work as I expected. I posted the question and the overall answer was that PureBasic does not support indirect reference and you would need to use the Poke(Pointer, ValueToStore) function to actually store information into an external simple variable.skywalk wrote:Remember, you can return a structure or modify the called parameters using @x,@y,@z.
^ This.glennj.0158 wrote:To determine which variable got which value you need to count in.
Me too when I have a need for Multiple return I prefer to do something like this :oreopa wrote:-1. Can't really see a need for this.
Code: Select all
Procedure MultipleReturn(a.f, b.f, c.f, *Return00_Float, *Return01_Float)
PokeF(*Return00_Float, ACos(a))
PokeF(*Return01_Float, ATan2(b, c))
EndProcedure
MultipleReturn(0.25, 0.25, 0.35, @Return00.f, @Return01.f)
Debug Return00
Debug Return01
Code: Select all
Procedure MultipleReturn(a.f, b.f, c.f, *Return00_Float.float, *Return01_Float.float)
*Return00_Float\f = ACos(a)
*Return01_Float\f = ATan2(b, c)
EndProcedure
MultipleReturn(0.25, 0.25, 0.35, @Return00.f, @Return01.f)
Debug Return00
Debug Return01
Code: Select all
width, height = 640, 480
x, y, z = 5, 10, 20
Code: Select all
Define.d x, y, z = 0.0, 1.0, 2.0
Code: Select all
Define.d x = 0.0
Define.d y = 1.0
Define.d z = 2.0