Subj : Re: Mulit dimensional arrays To : Jochen Stier From : Brendan Eich Date : Tue Mar 02 2004 02:11 pm Jochen Stier wrote: >The first [] would have to be a JS_GetProperty and the second [] a >JS_SetProperty. I guess >one could just create some kind of dummy object that encapsulates a float*, >i.e. a column of >the matrix, and return that from the JS_GetProperty call. I was wondering if >there is a better way of >doing that, because setting all of the fields in a matrix will result in a >lot of calls ! > Do you mean a lot of objects? Or do you mean calls to getProperty and setProperty (the JSClass hooks)? I don't see how JS_GetProperty and JS_SetProperty enter into it. An object per row is necessary. Alternatively, if you could rewrite the script, or have authors write it this way themselves, you could identify elements in the 2d array using identifiers such as '0,1' and '1,1' -- in other words, use string identifiers that concatenate the row and column indexes with a ',' in between. /be .