Forums > Gen

Refer to different variables or buffers inside gen~


Nov 14 2016 | 11:31 am

Hi everyone,
is it possible to sum two strings together to refer to different variables or buffers inside gen~? I’ll make you an example:
if i have 5 variables inside gen~, named var1, var2, var3, var4, var5, that need to be modified in the same way in a for loop , is it possible to access them dynamically?

Kind of like this:
for(i = 1; i < 5; i += 1)
{
"var" + "i" = ………. ;
}
instead of:
var1 = …;
var2 = …;
ecc..

Dec 04 2016 | 8:02 pm

Variables in gen do not hold strings, they hold 64-bit float values. What you normally do for this kind of thing is pass the variable into a function.

Viewing 2 posts - 1 through 2 (of 2 total)

Forums > Gen