ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2008-04-09T23:03:15+02:00 https://brainmodular.org/forums/app.php/feed/topic/788 2008-04-09T23:03:15+02:00 2008-04-09T23:03:15+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4068#p4068 <![CDATA[Scripting: Outputting a rapid flow of values]]> Statistics: Posted by bsork — 09 Apr 2008, 23:03


]]>
2008-04-09T17:18:01+02:00 2008-04-09T17:18:01+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4063#p4063 <![CDATA[Scripting: Outputting a rapid flow of values]]>
It took me a while, but now I finally got it. Now I understand the logic behind it. Thanks man.

antwan

Statistics: Posted by antwan — 09 Apr 2008, 17:18


]]>
2008-04-09T15:31:38+02:00 2008-04-09T15:31:38+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4062#p4062 <![CDATA[Scripting: Outputting a rapid flow of values]]>

CODE:

var b boolean; // switch already on?var i integer;...if &#40;trunc&#40;GetValue&#40;input&#41;=1&#41;&#41; then begin   if &#40;NOT b&#41; then begin      i &#58;= -1;      b &#58;= true;   end;   i &#58;= i + 1;   SetValue&#40;output, i&#41;;   if &#40;i = 7&#41; then       i &#58;= -1;endelse begin   b &#58;= false;end;

Statistics: Posted by bsork — 09 Apr 2008, 15:31


]]>
2008-04-09T14:26:13+02:00 2008-04-09T14:26:13+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4061#p4061 <![CDATA[Scripting: Outputting a rapid flow of values]]>
yes that seems to do the trick. but building upon this... what if i want that to happen once under some condition: let's say if this and that variable is 1 then output numbers from 0 to 7.
Just putting that part of code within a if-phrase clearly wont work because it is no longer a loop of any kind...

thanks again,

antwan

Statistics: Posted by antwan — 09 Apr 2008, 14:26


]]>
2008-04-09T13:48:23+02:00 2008-04-09T13:48:23+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4060#p4060 <![CDATA[Scripting: Outputting a rapid flow of values]]>
You have to rewrite the script to something like this:

CODE:

i &#58;= i + 1;if &#40;i = 7&#41; then   i &#58;= 0else  i &#58;= i + 1;SetValue&#40;output, i&#41;;

Statistics: Posted by bsork — 09 Apr 2008, 13:48


]]>
2008-04-09T13:10:04+02:00 2008-04-09T13:10:04+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4059#p4059 <![CDATA[Scripting: Outputting a rapid flow of values]]>
There's something i'm forgetting, i'm sure...
But it's a while since I've last been scripting. What I'm wondering is how to make the script output a fast flow of numeric values. I tried achieving that by using a for-loop, like:

for i := 0 to 7 do begin
SetValue(output, i);
end;

What I hoped to get with this is the values 0, 1, 2, 3, 4, 5, 6 and 7 in rapid succession in the outlet called "output". What I infact get in that outlet is 0 and then 7.

What am I missing. My skills are rusty! :)

Thanks,

antwan

Statistics: Posted by antwan — 09 Apr 2008, 13:10


]]>
BrainModular BrainModular Users Forum 2008-04-09T23:03:15+02:00 https://brainmodular.org/forums/app.php/feed/topic/788 2008-04-09T23:03:15+02:00 2008-04-09T23:03:15+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4068#p4068 <![CDATA[Scripting: Outputting a rapid flow of values]]> Statistics: Posted by bsork — 09 Apr 2008, 23:03


]]>
2008-04-09T17:18:01+02:00 2008-04-09T17:18:01+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4063#p4063 <![CDATA[Scripting: Outputting a rapid flow of values]]>
It took me a while, but now I finally got it. Now I understand the logic behind it. Thanks man.

antwan

Statistics: Posted by antwan — 09 Apr 2008, 17:18


]]>
2008-04-09T15:31:38+02:00 2008-04-09T15:31:38+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4062#p4062 <![CDATA[Scripting: Outputting a rapid flow of values]]>

CODE:

var b boolean; // switch already on?var i integer;...if &#40;trunc&#40;GetValue&#40;input&#41;=1&#41;&#41; then begin   if &#40;NOT b&#41; then begin      i &#58;= -1;      b &#58;= true;   end;   i &#58;= i + 1;   SetValue&#40;output, i&#41;;   if &#40;i = 7&#41; then       i &#58;= -1;endelse begin   b &#58;= false;end;

Statistics: Posted by bsork — 09 Apr 2008, 15:31


]]>
2008-04-09T14:26:13+02:00 2008-04-09T14:26:13+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4061#p4061 <![CDATA[Scripting: Outputting a rapid flow of values]]>
yes that seems to do the trick. but building upon this... what if i want that to happen once under some condition: let's say if this and that variable is 1 then output numbers from 0 to 7.
Just putting that part of code within a if-phrase clearly wont work because it is no longer a loop of any kind...

thanks again,

antwan

Statistics: Posted by antwan — 09 Apr 2008, 14:26


]]>
2008-04-09T13:48:23+02:00 2008-04-09T13:48:23+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4060#p4060 <![CDATA[Scripting: Outputting a rapid flow of values]]>
You have to rewrite the script to something like this:

CODE:

i &#58;= i + 1;if &#40;i = 7&#41; then   i &#58;= 0else  i &#58;= i + 1;SetValue&#40;output, i&#41;;

Statistics: Posted by bsork — 09 Apr 2008, 13:48


]]>
2008-04-09T13:10:04+02:00 2008-04-09T13:10:04+02:00 https://brainmodular.org/forums/viewtopic.php?t=788&p=4059#p4059 <![CDATA[Scripting: Outputting a rapid flow of values]]>
There's something i'm forgetting, i'm sure...
But it's a while since I've last been scripting. What I'm wondering is how to make the script output a fast flow of numeric values. I tried achieving that by using a for-loop, like:

for i := 0 to 7 do begin
SetValue(output, i);
end;

What I hoped to get with this is the values 0, 1, 2, 3, 4, 5, 6 and 7 in rapid succession in the outlet called "output". What I infact get in that outlet is 0 and then 7.

What am I missing. My skills are rusty! :)

Thanks,

antwan

Statistics: Posted by antwan — 09 Apr 2008, 13:10


]]>