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 Created Structure With Keys



I'm trying to use the JavaScript patch to create associative arrays. I'm trying to create an array with valid keys but can't find a way to do it. The associative arrays don't seem to set out a structure propperly.

I just tried it and the following JS function takes a normal array and outputs its first two entries in a keyed dictionary. Of course, there's way too little error checking in that code.


function (__structure dictionary) main (__structure array)
{
	var result = new Object();
	__structure temp = new Object();
	
	if (!_testMode) {
		temp["first"] = array[0];
		temp["second"] = array[1];
	}
	
	result.dictionary = temp;
	return result;
}

Could you maybe give us a concrete example of how your input looks and how the output should look like?

Marco
_______________________________________________
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 Created Structure With Keys (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.