From: Ammar Ali Date: 2010-12-02T05:46:24+09:00 Subject: Re: Help sorting an array On Wed, Dec 1, 2010 at 8:30 PM, Mike Stephens wrote: > If you've ever read "Real Programmers don't use Pascal" (see > http://www.codeproject.com/KB/scrapbook/realprog.aspx ) you'll know that > "Determined Real Programemrs can write Fortran programs in any language" > Just because you're a Ruby programmer you don't have to use all that OO > stuff. How can you use ruby without "all that OO stuff"? That's one of the main attractions. > def initialise_globals >  $m1 = "JANUARY" >  $m2 = "FEBRUARY" >  $m3 = "MARCH" > >  $m1_index = 0 >  $m2_index = 0 >  $m3_index = 0 > end Globals? Why? Constants are your friends. These values are already part of the Date class. require 'date' >> Date::MONTHNAMES [ nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] > def get_array >  $input_array = ["#", "#", "MARCH", > "#", > "#", "FEBRUARY", "#","JANUARY"] >  puts " #{$input_array}" > end This doesn't do whatever you think it does. I guess determined programmers can write VB programs in any language. Regards, Ammar