From: Brian Candler Date: 2007-05-06T16:24:34+09:00 Subject: Re: how to make "quit" at the end of "menu" On Sun, May 06, 2007 at 07:32:14AM +0900, Gpy Good wrote: > I create a ruby program that need a menu from database: > menu={ > "open file"=>"file.html", > "save file"=>"save_file.html", > "quit"=>"quit.rb" > } > > puts menu.inspect > > => > {"open file"=>"file.html", "quit"=>"quit.rb", "save > file"=>"save_file.html"} > > BUT,i hope that as I create menu's ordered > => > {"open file"=>"file.html", "save > file"=>"save_file.html","quit"=>"quit.rb"} If ordering is important, don't use a hash. menu = [ ['open file','file.html'], ['save file','save_file.html'], ['quit','quit.rb'], ]