Yeah I thought that was ok. It seems though that both dimensions are being set to the value in the first dimension. This code for instance gives an error:


instr 1, Init

    kArr1[][] init 5,10

    kIndx = 0

    until kIndx == 10 do
        
        kArr1[4][kIndx] = kIndx

        kIndx += 1
    od
    

    turnoff
endin


-- 
Edward Costello

On Wednesday 10 July 2013 at 22:30, Steven Yi wrote:

Hi Ed,

That's mostly right. The int dimensions is the number of dimensions,
and the sizes are essentially an int array that marks the sizes of
each dimension. So if you had an array of:

karray1[][][] init 3, 4, 5

that'd have 3 dimensions, with sizes 3, 4, and 5, and you could index
into the last element using:

karray1[2][3][4]

If you wanted a 2d array with 10 rows, and 3 columns, you could do:

karray1[][] init 10, 3

which would have 2 dimensions, with sizes[0] == 10, and sizes[1] == 3.

So you can use the dimensions member of the struct to check how much
you can index into the sizes array.

Hope that helps!
steven

On Wed, Jul 10, 2013 at 3:45 PM, Edward Costello
<edwardcostello@gmail.com> wrote:
Hi,

I am testing out making some opcodes using arrays and I was just wondering
if I understand the ARRAYDAT structure correctly. Does the sizes pointer
give the row and column dimensions? i.e. array->sizes[0] is the rows and
array->sizes[1] the columns?

If I make a score that has kArr[][] init 10,11 in it I get 10 for both
sizes[0] and sizes[1].


--
Edward Costello


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
_______________________________________________
Csound-devel mailing list

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel