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

Re: [sc-users] concatenating and iteration



ok. that brings me make to my original approach. i have a function that receives the values for one of its args from a different slider each time it's called.
slider1 = EZSlider...
slider2 = EZSlider...
slider3 = EZSlider...
slider4, etc.
//array with the names of all the sliders
slArray = [slider1, slider2, slider3...];

func = {|val|
    val.postln;
};

30.do({ |i|
    func.value(slArray[i])
});

i wasn't sure if there was a good way to avoid the slArray. that's really not a big deal though... i definitely will need something fast so interpret prob won't be good. thanks for the input everyone.

cheers,
jeremy

On Sep 5, 2005, at 1:45 AM, Till Bovermann wrote:

Hi,

better do something like

(
var q = [10, 9, 8, 7];

q.do({|item|
    item.postln
})
)

because of
1.) the numbers after q imply, that you want to have an ordered structure
2.) String-interpret is always wwaaaaay sloooooow...
3.) it looks nicer ;-)

hope that helps
Till


On 05 Sep 2005, at 10:06, Mario Lang wrote:


Jeremy Zuckerman <jz@xxxxxxxxxxxxxxx> writes:



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



("q"++i).interpret.postln



    })
)

//only i is returned not the values assign to q0, q1, etc.

thanks!



--
CYa,
  Mario

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users



_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users