Passing parameters by reference
Dar Scott
dsc at swcp.com
Fri Mar 9 20:05:59 EST 2012
Oh, that would be cool!
Maybe the array could be global (or passed as a parameter) and the subscript passed.
This works:
add 1 to a["x"]
... it seems like a reasonable thing to do. There might be problems I don't see right off, such as access to the same array at two different levels at the same time.
Dar
On Mar 9, 2012, at 4:30 PM, Pete wrote:
> I think I already know the answer to this so just confirming in case I'm
> missing something
>
> Let's say I have a handler with a parameter that is passed by reference, eg
> "command xyz @parm1". If I try to pass an element of an array, eg "xyz
> theArray[2]", I get a runtime error. If, however, I pass the whole array,
> eg "xyz theArray", all seems to work fine.
>
> That seems somewhat strange to me but apparently that's the way it is?
>
>
>
> --
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list