The problem is something like this: When it JS patch first starts,
structure inputs aren't valid (they're NULL), so you can't ask for
indexes etc. The version above first checks to make sure show_data
is valid, and then indexes it only when valid -- this gets around
the null value problem you ran into before.
As Christopher pointed out, the JS patch is executed once with all
input ports set tu NULL before it is actually used. Another way to get
around this yielding errors for structs is to simply check for the
global _testMode variable:
// Returns the number of elements inside a struct
function (__index count) main (__structure struct)
{
var result = new Object();
if (_testMode)
result.count = 0;
else
result.count = struct.length();
return result;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden