Indirect Addressing Another Stack

J. Landman Gay jacque at hyperactivesw.com
Wed Sep 24 17:32:28 EDT 2008


Mikey wrote:
> N00b/oldtimer here.
> 
> I have a stack that I've broken into a number of smaller stacks for
> the purpose of encapsulation.  One of those is a Preferences stack.
> I'd like to be able to pull in the contents of some fields on
> different cards on the Preferences stack, but in a more elegant way
> than
> 
> put field "prefix" of card "heading" of stack "preferences" into prefix
> 
> because this process gets repeated over and over.
> 
> 
> Do we have an indirect addressing route available so that I can, for
> instance, skip the stack reference?  I was hoping to avoid "do"
> because it makes the code harder to read, and I don't know if I'm in
> favor of "go" for this, either.

This is pretty much what "the defaultstack" is for. Set the 
defaultstack, and everything you refer to is in the context of that 
stack. If the object happens to be on the current card of that stack, 
you don't even need the card reference.

Or you can use the long id of an object:

  put the long id of btn 1 of card 2 of stack "mystack" into tObj
  put the name of tObj


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list