Get a handler from a script

Robert Brenstein rjb at robelko.com
Fri Mar 17 06:42:41 EST 2006


>Perhaps using
>
>set the wholematches to true
>put lineOffset("on" && pHandlerName, pScript) into tStart
>if tStart is 0 then put lineOffset("function" && pHandlerName, pScript) into
>tStart
>put (lineOffset("end" && pHandlerName, pScript) +1 into tEnd
>
>
>answer tStart & cr & tEnd
>
>Jim Ault
>Las Vegas
>

Unfortunately, wholematches can't be used, at least for the first 
lineoffset, because there are likely some parameters further in that 
line. The alternative to lineOffset is to use regex.

A truly generic function would need to know whether it searches for 
command or function, because it is possible to have one of each with 
the same name.

Robert



More information about the use-livecode mailing list