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 Patch Question




Alex,

Properties can also be accessed as named keys of an object. So you can do the following:

	for (i=0; i<=20; i++) {
		result[ "Matrix" + (i<10 ? "0"+i : i) ] = 1 / i;
	}

HTH,


Ade.


On 1 May 2008, at 14:40, Alex Drinkwater wrote:

This is as much a JavaScript syntax question as anything else, but I though, since it relates to something lots of you have probably tried to do in QC, I thought I'd give the good people of this forum a try.

I have 16 output ports from my JavaScript patch, consecutively named 'Matrix00', 'Matrix01', up to 'Matrix15'. Is there a simple way to use a loop to iteratively set the values for these outputs, without having to manually set each in a long list

result.Matrix00 = value1;
result.Matrix01 = value2;

etc.?

I've tried various number-to-string methods, but none seem to work.

Anyone any ideas?

_______________________________________________
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 Patch Question (From: Alex Drinkwater <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.