like pass, but without ending the handler

Dick Kriesel dick.kriesel at mail.com
Wed Feb 28 03:11:42 EST 2007


If you have a handler that needs to do something after letting the message
proceed along the message path, here¹s a pithy way:
    call the params of the owner of me

One example scenario involves a newGroup handler that needs its owner¹s more
general handler to run before the more specific handler can finish its task.

For a demonstration, try the following:

1. create a new main stack and give it this script:
     on foo p1,p2,p3
       put "hello from" && me && "with" && the params & cr after msg
     end foo
2. give the card this script:
     on foo p1,p2
       put ""
       call the params of the owner of me
       put "hello from" && me && "with" && the params & cr after msg
     end foo
3. in the message box, enter "foo 1,2,3" without the quotes
4. see the following:
     hello from stack "Untitled 1" with foo "1","2","3"
     hello from card id 1002 with foo "1","2","3"

It works for me.  If you find a case where it doesn't, please let me know.

Or is there a better way for an initialization handler to invoke its parents
without skipping remaining statements?

-- Dick





More information about the use-livecode mailing list