From: Paul Smith Date: 2009-09-22T01:05:51+09:00 Subject: Re: Incrementing variable names in a loop? 2009/9/21 Jesús Gabriel y Galán : > On Mon, Sep 21, 2009 at 5:43 PM, Paul Smith wrote: >> On Mon, Sep 21, 2009 at 4:09 PM, Matt Brooks wrote: >>> Problem is when I create this variable with an incrementing name, I >>> can't seem to append it to the end of the signals[0], because I can't do >>> #{} with another #{} inside of it. I would like this: >>> write_log("Bin_\##{index}: #{signals[0].#{variable}}") >> >> write_log("Bin_\##{index}: #{signals[0] + variable}") >> >> Or just >> >> call = signals[0] + variable >> write_log("Bin_\##{index}: #{call}") > > I might have misunderstood, but I think this doesn't do what the OP > wanted: to *call* the methods named bin_0, bin_1, etc on the > signals[0] object. > I think I misunderstood. I was focussing too hard on the #{} inside a #{} problem. > Jesus. > > -- Paul Smith http://www.nomadicfun.co.uk paul@pollyandpaul.co.uk