Activating a Function in a Different Stack

Bridger Maxwell bridgeyman at gmail.com
Mon Oct 30 19:45:40 CST 2006


Wow, thanks for the great response everyone.  I tried a few and I found that
the value function works the best.  I had actually been using virtual
properties in a few places instead of functions, but the problem then was
that I couldn't pass parameters to them.  Here is the final script:

    put "Stack" && where & quote into vStack
    put requestData && "of" && vStack into vRequest
    try
      put value(vRequest,vStack) into vReturn
    end try

One thing is still a little confusing though.  Calling a function like "the
short name of the current stack" return the name of the right stack, but a
request like "the mouseLoc" returns a value that is relative to the stack
that is retrieving the data, even if that stack isn't the top stack.  If the
mouseloc function is not relative to the top stack, and it is not relative
to the stack that the value is being requested from, how does it decide
which stack it is relative to and how can I know which functions are funny
like that?
Also one odd quirk I discovered was that when nesting value functions things
get weird.  i.e
value( (value(vRequest,vStack) ), vStack)
"the short name of me" would return "Odyssey" when the stack name was
"Odyssey Sensors", and  that was the only function that would come close to
working.  Not important, but very mystifying.

  TTFN
    Bridger



More information about the use-livecode mailing list