Subj : Re: Iterating through all Array elements from C To : netscape.public.mozilla.jseng From : Matthew Mondor Date : Fri Feb 11 2005 12:42 pm On Thu, 10 Feb 2005 14:32:16 -0500 Matthew Mondor wrote: > As for association arrays my method still fails so far. Will verify > if I could perhaps consider them properties and attempt to iterate > through properties of the supplied object. I played with JS_Enumerate(), and then ran through the returned ID array (although the documentation mentions this is for internal use only). For sparsely populated arrays, I can now obtain the entries specifying the index IDs to lookup into the user supplied array. As for associated arrays, I am able to obtain the name of the elements, although still unable to query their associated value so far, since I am obtaining a jsval string, while JS_LookupElement() requires an index integer. I tried using JS_ValueToID() on the jsval in hope to obtain an index, however this returns the same results as the IDs in the IdArray of course, not index suitable for JS_LookupElement(). Thanks again, Matt .