From: Rg Rg Date: 2009-03-09T04:29:09+09:00 Subject: Re: Referencing Variables By Name in a String - THANKS Michael Satterwhite wrote: > Sharagoz -- wrote: >> Is this what you're looking for? >> >> 1.upto(8) do |i| >> box = eval("pauseBox" + i.to_s) >> #do stuff with box >> end > > Exactly. Thanks ... I forgot about eval. > > Appreciate it much. > ---Michael Would it be possible to do the same thing, but generating the variable name? i.e. 1.upto(8) do |i| "pauseBox" + i.to_s = i + 1 #do stuff with box end This don't work -- Posted via http://www.ruby-forum.com/.