Posted: Mon Nov 25, 2002 4:52 pm
Restored from previous forum. Originally posted by talun.
To PureBasic programmers,
I'm new to PureBasic and I've a lot of problem to get accustomed with the "new" PureBasic rules.
By default, Win\DOS BASIC compilers (QuickBasic; PowerBasic and so on)pass parameters to a procedure by reference, while PureBasic seems to pass the parameters by value.
How I can make in order to pass the addresses of the parameters to the procedures in such way to modify them?
I have found a complicated way in order to make it but does not seem very corrected..
Procedure test(*a.l,*b.l)
PokeL(*a,2)
PokeS(*b,"b")
EndProcedure
x.l = 1
y.s = "a"
Debug Str(x)+","+y
test(@x,@y)
Debug Str(x)+","+y
Thanks to all
Sergio
To PureBasic programmers,
I'm new to PureBasic and I've a lot of problem to get accustomed with the "new" PureBasic rules.
By default, Win\DOS BASIC compilers (QuickBasic; PowerBasic and so on)pass parameters to a procedure by reference, while PureBasic seems to pass the parameters by value.
How I can make in order to pass the addresses of the parameters to the procedures in such way to modify them?
I have found a complicated way in order to make it but does not seem very corrected..
Procedure test(*a.l,*b.l)
PokeL(*a,2)
PokeS(*b,"b")
EndProcedure
x.l = 1
y.s = "a"
Debug Str(x)+","+y
test(@x,@y)
Debug Str(x)+","+y
Thanks to all
Sergio