From: corey konrad <0011@...> Date: 2006-05-15T07:36:41+09:00 Subject: Re: begining programmer questions oh ok i needed to remove the [] in the while loop to, ok. Now when i type exit the while loop ends but then the entire program ends instead of sorting the aray and printing it...? I dont understand that corey konrad wrote: > well i tried what you said but i still get an error now, it says that i > have the wrong number of arguments. I know it isnt that important of > program but i just dont understand the error messages. > > def input > puts "Enter some info" > info = [] > info << gets.chomp > while info[] != "exit" > info << gets.chomp > end > info.sort > puts "#{info}" > end > > > > corey konrad wrote: >> ok thanks for the help >> >> >> >> Michael Gorsuch wrote: >>> I suppose it could, but I think the easiest way to build an Array in >>> ruby is >>> as follows: >>> >>> info = [] >>> >>> You can build a Hash via: >>> >>> info = {} -- Posted via http://www.ruby-forum.com/.