check if handler exist before using it

Richard Gaskin ambassador at fourthworld.com
Fri Nov 9 20:28:01 EST 2007


Mark Wieder wrote:

>> But I must admit that the circumstances in which such a mechanism was 
>> useful have been very rare for me.   How often do you need to call a 
>> handler without knowing whether it's present?
> 
> I actually end up doing this quite often: one behavior if a secondary stack 
> is present, another behavior if it isn't. That allows me to add substacks as 
> optional components and not throw errors if they aren't in a given 
> distribution.

I may be a bit slow today as I'm caffeine free this afternoon, but 
wouldn't checking for the presence of the stack do the same as checking 
for its handlers?

-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list