check if handler exist before using it

Thierry 00bioarchimed at free.fr
Sat Nov 10 05:03:06 EST 2007


Hi Mark,

Thanks for saying this.. it's more or less
exactly what I meant, with a little difference in that I'm not
only looking for only a stack presence or not, but for a handler  
presence or not
in any object ( stack, controls, lib ).

Plus all this has to be checked from inside an External, via the
SendCardMessage(..) or EvalExpr(...) available in the External API.

With few tries, at the moment, I found that the Error catched
is "Error parsing expression", but don't know yet if it will always
be the error message depending on different contexts !

As I'm offering a specific tool, I need to throw these kind of errors
before actually executing the relevant code.

Well, hope you get the idea ?

Regards,
Thierry

> Richard-
>
>> 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.
>  Mark Wieder





More information about the use-livecode mailing list