message hierarchy question

Dick Kriesel dick.kriesel at mail.com
Thu Jan 5 04:15:46 EST 2006


On 1/4/06 11:37 PM, "Mark Wieder" <mwieder at ahsoftware.net> wrote:

> put the script of stack "substack 1" of stack "A" into back

I suppose you meant "insert" rather than "put."

Are you implementing polymorphism for functions and commands?  Is only one
substack appropriate at any point in time?  Do you need to remove the script
of stack "substack 1" of stack "A" and insert the script of "substack 2" of
stack "A" when some event occurs?  And remove and insert again when other
events occur?

If yes, then there's another technique you can use.  You can insert the
script of stack "A" which can contain virtual functions and commands:

function foo
  put the uSubstack of me into tSubstack
  if tSubstack is not empty then
    return value(the params,stack tSubstack)
  end if
end foo

on bar
  put the uSubstack of me into tSubstack
  if tSubstack is not empty then
    send the params to stack tSubstack
  end if
end bar

Then when some event requires a change to a different substack, you can set
the uSubstack of stack "A" and not need to remove and insert scripts.  Would
that work for you?

-- Dick





More information about the use-livecode mailing list