|
Post by tomd100 on Mar 7, 2019 7:31:52 GMT
Is there a quick way to initialise all global variable elements within a script in StreamByter without using ASS for each array element? At the moment I close MidiFire and restart to make sure all global variables are reset.
Thanks Tom
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Mar 7, 2019 8:22:56 GMT
Hi tomd100 , You can use up to 16 values in one ASS statement to initialise sequential sections of the array, like: IF LOAD ASS G00 = 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ASS G10 = 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ENDOr if you want to initialise everything to the same value you can use a loop: IF LOAD ASS I0 = 0 # loop counter IF I0 < 80 +L # loop ASS GI0 = 00 # assign Gxx to 0 MAT I0 = I0 + 1 # increment loop counter END ENDMake sure this is done in the first Stream Byter module dropped onto the MidiFire canvas though. Regards, Nic.
|
|
|
Post by tomd100 on Mar 12, 2019 11:35:47 GMT
Thanks Nic - I went with the loop idea - one question: in your example you don't show the +L flag for the loop, is that just a shortcut and it is implied or is loop behaviour different in a LOAD section?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Mar 12, 2019 11:37:40 GMT
Hi tomd100 , Ooops - no, that is an error - that would only initialise G0. You definitely need the +L I have amended my code above. Regards, Nic.
|
|