Pass by reference

Very basic question:

how to pass global variables by reference (e.g. change their values)?

~zxc = {arg a; a=3}

~afa = 6

I believe that the way to achieve this in SC is by using a Ref object or storing your value in e.g. a Dictionary that you pass to the function.

Thanks, it works actually in this way:

~zxc = {arg a; currentEnvironment[a]=3}

~afa = 6
1 Like