overriding a function

Dick Kriesel dick.kriesel at mail.com
Wed Jun 24 04:50:39 EDT 2015


> On Jun 23, 2015, at 10:39 PM, Monte Goulding <monte at sweattechnologies.com> wrote:
> 
> Howdy folks
> 
> I’m doing a bit of IDE hacking for a new plugin and I want to override a function in one of the libraries or rather add some lines to it’s results. The only way I can override is via a front script but ideally I would be able to get the result of the function being overridden, amend it and then return my amended result.
...
> However I know I can’t do the above because I’d just end up with recursion in my front script… any ideas?

Hi, Monte.  Here’s a way to write the handler for your front script:

function getLines
    if item 2 of line -2 of the executionContexts is "getLines" then
        pass getLines
    else
        return "Hello" & cr & getLines()
    end if
end getLines

It works for me.  Does it work for you?

— Dick



More information about the use-livecode mailing list