I have an array() called patchPresets ; each array element is an object. The
object has the following keys .no, .data, .name as number, object and text
respectively. If I want to rewrite a particular element based on the "no"
key can I do so directly (as I would to an array element who's index value I
had already) or do I have to iterate through the elements to find an element
as in:   patchPresets [i] = patch;
   if ( patch.no = theRightNumber )
        patchPresets [i] = myNewPatch;
        break;

If patchPresets was an Object() would there be a way to overwrite directly
to an item with patch.no == theRightNumber?

This aspect of objects has been doing the rounds of my mind for some weeks
and my reading hasn't illuminated these subtleties (sophistries if I'm way
off mark with all this). I realise I need to take a programming course in a
contemporary scripting language ;) but in the mean time...

The other possible container solution I'm considering is to use an array and
just assign each patch object using the index value equal to patch number.
Then I have lots of potentially empty elements (90 elements all up) and I'm
not sure what implications that has in QC JS for memory use/performance
drag. Does QC automatically convert arrays to an object anyway and pack it
all down or reserve bytes based on the largest element (which could be MB
large in case of an image). .data element is 90 objects which may be
numbers, colours, strings or QCstructures themselves so looking at 90 * 90 =
1800 objects stored. Switching between the presets patches doesn't have to
be rapid-fire but may prove useful if I can make it so.

Hope this makes some
sense, probably reads like an Englishman tying to speak poor-broken German to
you Programmers. Apologies. Gratitude in advance.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to