How to pass simple variables by reference to a procedure

Just starting out? Need help? Post your questions and find answers here.
pf shadoko
Posts: 74
Joined: Thu May 26, 2016 11:09 am

How to pass simple variables by reference to a procedure

Post by pf shadoko »

How to pass simple variables by reference to a procedure

this code don't work on SB:

Code: Select all

Procedure test(*v.long)
    *v\l=1111
EndProcedure

Define v.l

test(@v)

Debug v
Sirius-2337
Posts: 35
Joined: Wed Mar 26, 2014 5:47 pm

Re: How to pass simple variables by reference to a procedure

Post by Sirius-2337 »

This is a limitation of SB.
See here: http://forums.spiderbasic.com/viewtopic ... rt=2#p1725
and also reported here: http://forums.spiderbasic.com/viewtopic ... =835#p2719

You may try this:

Code: Select all

Procedure test(*v.long)
    *v\l=1111
EndProcedure

Define v.long

test(@v)

Debug v\l
pf shadoko
Posts: 74
Joined: Thu May 26, 2016 11:09 am

Re: How to pass simple variables by reference to a procedure

Post by pf shadoko »

ok
thanks
Post Reply