ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2008-10-28T13:19:33+02:00 https://brainmodular.com/forums/app.php/feed/topic/1095 2008-10-28T13:19:33+02:00 2008-10-28T13:19:33+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5946#p5946 <![CDATA[Scripting and Array length]]> I will have a look at the Random Pattern Array to get the idea.

Cheers,

antwan

Statistics: Posted by antwan — 28 Oct 2008, 12:19


]]>
2008-10-28T12:40:21+02:00 2008-10-28T12:40:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5945#p5945 <![CDATA[Scripting and Array length]]>
There's a good example in the DataRandom GeneratorsRandom Pattern Array.script, where the ArrayOut variable is an array of tParameter. I've done the same thing in some of my add-ons, but I don't recall which right now.

Statistics: Posted by bsork — 28 Oct 2008, 11:40


]]>
2008-10-28T11:33:22+02:00 2008-10-28T11:33:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5942#p5942 <![CDATA[Scripting and Array length]]>
Thanks for fixing this one; the scripting may go on!
I have another question though.

If I have code getting or setting values from/to inputs/outputs, for example:
GetLength(pArray)
Is there a way to somehow cast a string variable in the place of pArray. To make myself clear: if I have a string variable called currentInput containing either 'pArray' or 'pArray2', set elsewhere in the program, is there a way to use currentInput in the place of pArray, in this example. Obviously it doesn't work directly, but I'm wondering if there's some way to make it work?

Thanks, once again.

antwan

Statistics: Posted by antwan — 28 Oct 2008, 10:33


]]>
2008-10-25T10:15:46+02:00 2008-10-25T10:15:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5893#p5893 <![CDATA[Scripting and Array length]]>
@bsork: you better know the scripting engine than me! really! The only difference is that I can take a look into the source code and know if eventually it's a bug...

Statistics: Posted by senso — 25 Oct 2008, 10:15


]]>
2008-10-24T22:14:42+02:00 2008-10-24T22:14:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5884#p5884 <![CDATA[Scripting and Array length]]>

I know he has been doing a lot of stuff lately that has to do with zero length arrays and how to handle them etc.

Statistics: Posted by bsork — 24 Oct 2008, 22:14


]]>
2008-10-24T13:03:44+02:00 2008-10-24T13:03:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5874#p5874 <![CDATA[Scripting and Array length]]>
I'm confused about this little problem:
When I wire up a empty (size 0) array to the array-inlet of the simple example script, shown below, and an "execute" button to the execute-inlet, it claims that the length of the array is 1.
Here's the script to demonstrate:

CODE:

VAR pArray    &#58; TParameter;VAR pExecute  &#58; TParameter;VAR len       &#58; integer;// initialisation &#58; create parametersPROCEDURE init;BEGIN  pArray &#58;= CreateParam&#40;'Array in', ptArray&#41;; SetIsOutput&#40;pArray, FALSE&#41;;  pExecute &#58;= CreateParam&#40;'Execute', ptButton&#41;; SetIsOutput&#40;pExecute, FALSE&#41;;END;BEGIN  IF &#40;GetValue &#40;pExecute&#41; = 1&#41; THEN BEGIN     len &#58;= GetLength&#40;pArray&#41;;     writeln&#40;intToStr&#40;len&#41;&#41;;  END;
Why do you reckon?
Any help much appreciated.

antwan

Statistics: Posted by antwan — 24 Oct 2008, 13:03


]]>
BrainModular BrainModular Users Forum 2008-10-28T13:19:33+02:00 https://brainmodular.com/forums/app.php/feed/topic/1095 2008-10-28T13:19:33+02:00 2008-10-28T13:19:33+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5946#p5946 <![CDATA[Scripting and Array length]]> I will have a look at the Random Pattern Array to get the idea.

Cheers,

antwan

Statistics: Posted by antwan — 28 Oct 2008, 12:19


]]>
2008-10-28T12:40:21+02:00 2008-10-28T12:40:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5945#p5945 <![CDATA[Scripting and Array length]]>
There's a good example in the DataRandom GeneratorsRandom Pattern Array.script, where the ArrayOut variable is an array of tParameter. I've done the same thing in some of my add-ons, but I don't recall which right now.

Statistics: Posted by bsork — 28 Oct 2008, 11:40


]]>
2008-10-28T11:33:22+02:00 2008-10-28T11:33:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5942#p5942 <![CDATA[Scripting and Array length]]>
Thanks for fixing this one; the scripting may go on!
I have another question though.

If I have code getting or setting values from/to inputs/outputs, for example:
GetLength(pArray)
Is there a way to somehow cast a string variable in the place of pArray. To make myself clear: if I have a string variable called currentInput containing either 'pArray' or 'pArray2', set elsewhere in the program, is there a way to use currentInput in the place of pArray, in this example. Obviously it doesn't work directly, but I'm wondering if there's some way to make it work?

Thanks, once again.

antwan

Statistics: Posted by antwan — 28 Oct 2008, 10:33


]]>
2008-10-25T10:15:46+02:00 2008-10-25T10:15:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5893#p5893 <![CDATA[Scripting and Array length]]>
@bsork: you better know the scripting engine than me! really! The only difference is that I can take a look into the source code and know if eventually it's a bug...

Statistics: Posted by senso — 25 Oct 2008, 10:15


]]>
2008-10-24T22:14:42+02:00 2008-10-24T22:14:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5884#p5884 <![CDATA[Scripting and Array length]]>

I know he has been doing a lot of stuff lately that has to do with zero length arrays and how to handle them etc.

Statistics: Posted by bsork — 24 Oct 2008, 22:14


]]>
2008-10-24T13:03:44+02:00 2008-10-24T13:03:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=1095&p=5874#p5874 <![CDATA[Scripting and Array length]]>
I'm confused about this little problem:
When I wire up a empty (size 0) array to the array-inlet of the simple example script, shown below, and an "execute" button to the execute-inlet, it claims that the length of the array is 1.
Here's the script to demonstrate:

CODE:

VAR pArray    &#58; TParameter;VAR pExecute  &#58; TParameter;VAR len       &#58; integer;// initialisation &#58; create parametersPROCEDURE init;BEGIN  pArray &#58;= CreateParam&#40;'Array in', ptArray&#41;; SetIsOutput&#40;pArray, FALSE&#41;;  pExecute &#58;= CreateParam&#40;'Execute', ptButton&#41;; SetIsOutput&#40;pExecute, FALSE&#41;;END;BEGIN  IF &#40;GetValue &#40;pExecute&#41; = 1&#41; THEN BEGIN     len &#58;= GetLength&#40;pArray&#41;;     writeln&#40;intToStr&#40;len&#41;&#41;;  END;
Why do you reckon?
Any help much appreciated.

antwan

Statistics: Posted by antwan — 24 Oct 2008, 13:03


]]>