Holiday notice: Cycling '74 will be closed on Dec 25th, 26th, and Jan 1st. Manual authorization, support cases, and manual order processing will be delayed.
Is there a way to pass a "Data" name as a parameter on a declared function in gen~'s codebox?
I want to have a function alter some values in various Data arrays, is it possible without hardcoding the Data names in my algorithm?
Should be possible. Quick test, and it does work, though it did turn up a minor bug (now logged internally):
fun(dat, val) {
poke(dat, val);
// minor bug: a return value is necessary, or else the function might be wrongly optimized away
return val;
}
Data a(1);
Data b(1);
out1 = peek(a, 0);
out2 = peek(b, 0);
fun(a, 7);
fun(b, 4);
Just don't try returning Data/Buffer etc. from a function -- that isn't supported (yet).