From: 7stud -- Date: 2009-09-16T03:45:20+09:00 Subject: Re: Array of Hashes in an array of hashes - Complicated! Matt Brooks wrote: > Hi John, > Thanks for the input, how might I create a variable number of objects > with different object names though? > > if the following while loop happens the same object is created over and > over again. I loose say the other 30 signal objects i have made. As I > was saying before how would you increment a variable name or object name > in this implementation? > > while index < num_signals > sig_1 = Signal.new > .... > .... > end > You wouldn't. signals = [] while index < num_signals signals << Signal.new end > > Also, I would need a way to overwrite and kill all the objects every 10 > seconds or so, when all the signals update with different information. > Is that possible? > signals = [] > How might I keep track of all the signal objects created and all their > unique names and then kill them, so that I can then make a variable > number of new signal objects that contain a different number of > variables possibly, and definitely different data. > > Thanks! > Matt -- Posted via http://www.ruby-forum.com/.