functions in other stacks: how to call?

Jeanne A. E. DeVoto jeanne at runrev.com
Sun Dec 1 16:29:01 EST 2002


At 8:20 AM -0800 12/1/02, Oliver Hardt wrote:
>hello:  i have a project with several stacks.  if i am in stack A and
>want to call a function that is in the stack script of stack B, how
>do i do it?

Besides Jan's suggestion of "start using" (or "insert script", which is
similar), you can use the value function to specify the object whose script
contains the function you want to use. For example, if the script of stack
"My Stack" contains a function called "myFunction", you can use the value
function like this in any script:

  put value("myFunction()", stack "My Stack) into myValue

Generally, the value function is more appropriate if you have a "one-shot"
need to call a function that's in an object not in the message path;
"insert script" and "start using" are more appropriate if you need to call
functions from time to time throughout your app.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the Use-livecode mailing list