jheriko
1st September 2002 20:52 UTC
arrays in superscope
i quickly read the list but didn't spot any requests for arrays
arrays... i want arrays. i have had to abandon so many cool ideas cos handling 50 variables where a single array could do the job has made it to hard to finish code (i don't have the patience to code huge ssc's and dm's, i like to make my presets in less than half an hour each). even 1 dimensional arrays would suit me fine but 2 or 3 would be nice too and excessively useful.
djcoolman
11th September 2002 13:38 UTC
dmmmmm
You R ABS right!!!
Arrays and fast.
piR
9th October 2003 12:47 UTC
I know : I don't have to wake up old threads, but, in this case, it's now or never.
The imminent new version of AVS gives us more local variables and globals. That's very well, but the lack of arrays is still there.
If Justin is reading this, I suggest :
* A special function array() with one parameter (or more) that is the dimension of the array. Example :
t=array(40); // Creates (and initializes) an array t of 40 occurrences
* A new syntax to use the occurences of an array, using square brackets. Example :
t[8] is the 9th occurrence (t[0] is the first) of the array t
t[n] is the occurrence n-1 (n converted into integer)
* AVS must then manage an internal array with the adresses of the allocated memory for each new user array, and it has to free them before loading a new preset, or before living AVS.
Zevensoft
9th October 2003 15:08 UTC
It's shitloads easier to structure it like a null return function, ie.
t=setarray(arraynum,index,value);
and
value=getarray(arraynum,index);
Although might be good to have a t=dimarray(arraynum,size) first.
UnConeD
9th October 2003 17:48 UTC
You can already have implicit looping with a superscope or DM, using a var like p=p+1.
Arrays with setarray(), getarray() would be neat. Though I expect it to be easier syntactically if it uses the c convention of array[].