Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaScript Structure Handling



I'm just starting to work with Quartz and JavaScript and running into some brick walls with structures.


try this code:

function (__image output) main (__structure show_data)
{
	var result = new Object();
	
	var value = show_data;
	if(show_data != undefined)
	{
		result.output = value[0];
	}
	
	return result;
}

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.

--
[ christopher wright ]
email@hidden
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

This email sent to email@hidden

References: 
 >JavaScript Structure Handling (From: Steven Sokulski <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.