getlogical() substitute, apply() – can't exit early

Dec 2, 2012 at 11:09pm

getlogical() substitute, apply() – can't exit early

In needing a work around for the getlogical() function that crashes Max6 (, I’ve started using apply() which is doing the job with one hitch: It says it needs to return true to continue iterations, but when I try to return a false to end early (a patcher with a lot of objects to check every time) it doesn’t exit. The sample code is:
function printobj(a)
return true;
// iterfun must return true to continue
// iterating, else stops


I’d like to jump out early upon finding my object if possible.

This also makes me wonder what the real difference is between apply() and getlogical(). Is one there for legacy support?

If it makes it any clearer (hard to imagine with my coding) here’re the patchers and javascript I’m working with. These are for testing this capability. This uses the mouse, but it’s for a touch screen which is why I’m not just using the hover object.

Thanks for any help!

Dec 2, 2012 at 11:15pm

…and the files


You must be logged in to reply to this topic.