[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] dynamic variable values




hello sc-list,

i'm having a modest syntax problem, which i'm hoping somebody can shed some light on.

i'm trying to dynamically access the value of a variable (identifier) by interpreting a string and a number as demonstrated below.

(

	var vview_0 = 20;
	
	//"vview_"++0.asSymbol.postln;
	//["vview_"++0].asString.compile.postln;
	
	("vview_"++0).asString.interpret.postln;


)

searching through the list and some old code, i got the impression that i should be using interpret, but that didn't do the trick. i always get the following error:

Variable 'vview_0' not defined.

thanks,

jeremy

www.mantissa.ca