Stack overflow

I’m working on a large patch where I want to make colls out of a large cellblock using a coll which describes the rows and columns to put in the coll.

It uses a counter to go to the next columnnumber, and also a counter to go to the next row number.
So basically it should do this:

Get first row -> Get first column -> Get second column -> etc. -> Put in coll at index 1 -> Go to next row.
Get second row -> Get first column -> Get second column -> etc. -> Put in coll at index 2 -> Go to next row.

But, if I don’t put a delay somewhere in the ‘loop’, it get’s a stack overflow after going performing four rows.

Does this mean without the delay it’s an actual loop MAX can’t handle?

With a delay of 0.00001ms it works fine, but is pretty slow when I want values from say 1000 rows. Using deferlow instead makes it even slower…

Thanks for your reply.
Between the 3rd and 4th nothing different happens than between the others before.

I can’t send the patch (working for a company, can’t reveal too much).

What do you mean with trace?
I did use the debugger to monitor what happens.
My guess is that MAX sees it as a loop.
So the question is: How can I use a counter to perform the same thing as often as needed, but that waits with the next count till the current is completed.

> So basically it should do this:
>
> Get first row -> Get first column -> Get second column -> etc. -> Put in coll at index 1 -> Go to next row.
> Get second row -> Get first column -> Get second column -> etc. -> Put in coll at index 2 -> Go to next row.

Thanks for the example Arne. I can definetely use that. I tried to use deferlow, but not in this way.

Klaas-Jan, thanks as well. It’s partially what I meant. This is a nice way to get a cellblock in a coll, which I need as well.
But I sometimes also need to get a specific row range and columns in a coll.

> t’s partially what I meant. This is a nice way to get a cellblock in a coll, which I need as well.
> But I sometimes also need to get a specific row range and columns in a coll.
>
> Like:
> Row 1: Columns 1, 2, 4, 6
> Row 2: Columns 2, 4, 6, 7
> etc.

I see. You can lookup specific values after dumping in coll, or straight from jit.cellblock.