Get a handler from a script
Mark Smith
mark at maseurope.net
Fri Mar 17 07:19:29 EST 2006
Commenting would only affect things if the wholeMatches is set to
true - normally, lineOffset will get the right line even if it's
commented out, no?
Mark
On 17 Mar 2006, at 12:06, David Burgun wrote:
> Hi,
>
> Of course none of the solutions so far work if the function is
> commented out. To make the code 100% foolproof is a lot of work. I
> was doing something similar and found that comments made life
> really difficult.
>
> All the Best
> Dave
>
> On 17 Mar 2006, at 11:42, Robert Brenstein wrote:
>
>>> 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
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list