Get a handler from a script

Mark Wieder mwieder at ahsoftware.net
Sun Mar 19 15:51:18 EST 2006


David-

Sunday, March 19, 2006, 5:18:27 AM, you wrote:

> This this will work if the Hander is NOT commented out, but will fail
> with an error if the handler IS commented out. Also if you have a  
> comment in a Script that just happens to contain "on HandlerName"  
> then the "if" will succeed even though there is no handler defined.

Here's a line I learned from Jerry Daniels:

filter tScript with "[ofsgOFSG][nueNUE][ ntNT]*"

If necessary you can say:

replace space & space with space in tScript

Then you just check for the handler you're looking for:

if lineOffset("on" && HandlerName, tScript) is not zero then...

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the Use-livecode mailing list