[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] concatenating and iteration
This works:
(
~q0=10;
~q1=9;
~q2=8;
~q3=7;
4.do({|i|
("(~q"++i++").postln").interpret;
})
)
although for some reason I couldn't get it to work when using local
variables, not sure why. (Perhaps the interpreted string doesn't
inherit the scope? Seems odd.)
The way you wrote it, the value of the variable q and the value of the
variable i were being summed and posted.
Best
Dan
2005/9/5, Jeremy Zuckerman <jz@xxxxxxxxxxxxxxx>:
> how would i get the values assigned to the vars to return in this situation:
> (
> var q0, q1, q2, q3;
> q0 = 10; q1=9; q2=8; q3=7;
>
> 4.do({|i|
> (q++i).postln
> })
> )
>
> //only i is returned not the values assign to q0, q1, etc.
>
> thanks!
>
>
> _______________________________________________
> sc-users mailing list
> sc-users@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>
>
>
--
http://www.mcld.co.uk