It appears that on 9/30/99 7:33 PM, Karl Becker [EMAIL PROTECTED] wrote:
>So my question: how can I have the contents of a variable point to a
>variable name? If there isn't an indirection operator in MC already
>(which I don't think there is) , maybe it'd be nice to have one? (It'd
Actually, there is something very much like pointers: the "Do" command:
on mouseUp
put "myVar" into pointerVar
put "some value" into sourceVar
do ("put sourceVar into" && pointerVar)
answer myVar
end mouseUp
after this executes, the variable myVar will contain "some value"
You take a performance hit using do, and the sytax can get a little
tricky if you try to use string literals, but other than that, there you
go.
Using a string literal the above would be:
on mouseUp
put "myVar" into pointerVar
put "some value" into sourceVar
do ("put" && quote & "some value" & quote && "into" && pointerVar)
answer myVar
end mouseUp
gc
Geoff Canyon [EMAIL PROTECTED]
"C.D. Caterpillar teaches kids how to read, not how to watch cartoons."