From: Mark Mr Date: 2007-12-13T01:48:15+09:00 Subject: Re: While statements in ruby oh ok well thanks for the tip. I tried replying via the google group page but it didnt show up so I'll post it here instead. In response to this reply: If you are really just working with two arrays that map one-to-one and onto each other, why not use one array? An array of hashes perhaps. Like: q_and_as = [ {:question => 'Is it blue?', :answer => 'Yes'}, {:question => 'Is it round?', :answer => 'No'} ] Then use Array's each method: q_and_as.each do |query| puts "#{query[:question]}" puts "#{query[:answer]}" end HTH, Chris I wanted to do this too but I didnt know how in Ruby. How would I add to an array like this using variables in a loop? If I knew that I could make it alot easier. Thanks :) -- Posted via http://www.ruby-forum.com/.