ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2025-04-24T11:43:15+02:00 https://brainmodular.org/forums/app.php/feed/topic/7350 2025-04-24T11:43:15+02:00 2025-04-24T11:43:15+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45799#p45799 <![CDATA[Re: multidimensional arrays in scripts?]]>
However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.

var x: array [1..8] of array[] of integer;

I'll see if Usine lets me do that....
Sure it will work.

Statistics: Posted by senso — 24 Apr 2025, 11:43


]]>
2025-04-23T13:53:02+02:00 2025-04-23T13:53:02+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45795#p45795 <![CDATA[Re: multidimensional arrays in scripts?]]> If you want variable size array, the best should be to use vectors en C++, and make a user module.

or a simpler way, use polyphony and an array within a sub-array ?

if the process is too heavy on the CPU, you can also use the "procedure" method.

cheers

Statistics: Posted by oli_lab — 23 Apr 2025, 13:53


]]>
2025-04-21T21:38:42+02:00 2025-04-21T21:38:42+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45789#p45789 <![CDATA[Re: multidimensional arrays in scripts?]]>
I am still curious what particular brand of pascal Usine uses....

I found a workaround that keeps my code more readable:

for i = 0 to max
for j = 0 to max
idx = //compute from i and j
do stuff with array[idx]

However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.

var x: array [1..8] of array[] of integer;

I'll see if Usine lets me do that....

Statistics: Posted by woodslanding — 21 Apr 2025, 21:38


]]>
2025-04-17T15:43:24+02:00 2025-04-17T15:43:24+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45783#p45783 <![CDATA[Re: multidimensional arrays in scripts?]]>

CODE:

var x: array [1..5] of array [1..9] of integer// and inside the code   x[i][j] := i*j;

Statistics: Posted by senso — 17 Apr 2025, 15:43


]]>
2025-04-17T08:06:34+02:00 2025-04-17T08:06:34+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45782#p45782 <![CDATA[Re: multidimensional arrays in scripts?]]>
We don't have multidimensional arrays in Usine. We talked many times about that, but never went through.
Actually, there's a solution if you really need it. A comma-text can be think as a multidimensional array, but you have to manipulation either string and data. There's an example in the French section of the forum, viewtopic.php?f=25&t=7318

Best
Sylvain

Statistics: Posted by SylvainT — 17 Apr 2025, 08:06


]]>
2025-04-14T18:48:29+02:00 2025-04-14T18:48:29+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45777#p45777 <![CDATA[multidimensional arrays in scripts?]]>
var x: array [1..5, 1..9] of integer;

but usine complains about the comma.

Can we use multi-dimensional arrays? If so how?

And more broadly, what variant of pascal does usine actually employ??

THANKS!
-eric

Statistics: Posted by woodslanding — 14 Apr 2025, 18:48


]]>
BrainModular BrainModular Users Forum 2025-04-24T11:43:15+02:00 https://brainmodular.org/forums/app.php/feed/topic/7350 2025-04-24T11:43:15+02:00 2025-04-24T11:43:15+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45799#p45799 <![CDATA[Re: multidimensional arrays in scripts?]]>
However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.

var x: array [1..8] of array[] of integer;

I'll see if Usine lets me do that....
Sure it will work.

Statistics: Posted by senso — 24 Apr 2025, 11:43


]]>
2025-04-23T13:53:02+02:00 2025-04-23T13:53:02+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45795#p45795 <![CDATA[Re: multidimensional arrays in scripts?]]> If you want variable size array, the best should be to use vectors en C++, and make a user module.

or a simpler way, use polyphony and an array within a sub-array ?

if the process is too heavy on the CPU, you can also use the "procedure" method.

cheers

Statistics: Posted by oli_lab — 23 Apr 2025, 13:53


]]>
2025-04-21T21:38:42+02:00 2025-04-21T21:38:42+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45789#p45789 <![CDATA[Re: multidimensional arrays in scripts?]]>
I am still curious what particular brand of pascal Usine uses....

I found a workaround that keeps my code more readable:

for i = 0 to max
for j = 0 to max
idx = //compute from i and j
do stuff with array[idx]

However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.

var x: array [1..8] of array[] of integer;

I'll see if Usine lets me do that....

Statistics: Posted by woodslanding — 21 Apr 2025, 21:38


]]>
2025-04-17T15:43:24+02:00 2025-04-17T15:43:24+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45783#p45783 <![CDATA[Re: multidimensional arrays in scripts?]]>

CODE:

var x: array [1..5] of array [1..9] of integer// and inside the code   x[i][j] := i*j;

Statistics: Posted by senso — 17 Apr 2025, 15:43


]]>
2025-04-17T08:06:34+02:00 2025-04-17T08:06:34+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45782#p45782 <![CDATA[Re: multidimensional arrays in scripts?]]>
We don't have multidimensional arrays in Usine. We talked many times about that, but never went through.
Actually, there's a solution if you really need it. A comma-text can be think as a multidimensional array, but you have to manipulation either string and data. There's an example in the French section of the forum, viewtopic.php?f=25&t=7318

Best
Sylvain

Statistics: Posted by SylvainT — 17 Apr 2025, 08:06


]]>
2025-04-14T18:48:29+02:00 2025-04-14T18:48:29+02:00 https://brainmodular.org/forums/viewtopic.php?t=7350&p=45777#p45777 <![CDATA[multidimensional arrays in scripts?]]>
var x: array [1..5, 1..9] of integer;

but usine complains about the comma.

Can we use multi-dimensional arrays? If so how?

And more broadly, what variant of pascal does usine actually employ??

THANKS!
-eric

Statistics: Posted by woodslanding — 14 Apr 2025, 18:48


]]>