finding "global" procedures

Richard Gaskin ambassador at fourthworld.com
Wed Jun 1 20:46:23 EDT 2005


Jon wrote:
> I'm not sure I want to insert a message handler in the normal message 
> passing hierarchy. I don't want it to ever be called automatically.   I 
> want to be able to call a handler manually, from another handler.  At 
> the moment, unless the two handlers are in the same "file", I can't call 
> it because I can't "see" it.  I just want to be able to declare a 
> handler that can be invoked manually from anywhere in the program.  This 
> is a visibility issue.
> 
> I hope I'm making this clear[er].
> 
> :)
> 
> Jon
> 
> 
> Dan Shafer wrote:
> 
>> You raise an important issue. To program effectively in Revolution,  
>> you really need to understand the message-passing hierarchy. Nobody  
>> has explained it better than Richard Gaskin at:
>>
>> http://www.fourthworld.com/embassy/articles/revolution_message_path.html

See the section there labeled "Changing the Firing Order of Messages":

    While messages ordinarily travel only through the message
    path as shown in the figures above, you can invoke handlers
    in scripts of objects outside of the current message path
    with the send and call commands:

      send "mouseUp" to button "Cancel"

      call "CalculateTotals" of button "Total"

    The difference between the send and call commands is that
    the send command changes the context so that object references
    are treated as relative to the object you send the message to,
    while the call command does not change the context and continues
    to treat object references relative to the original object.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  Developer of WebMerge: Publish any database on any Web site
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the use-livecode mailing list