sorry guys..its company code cannot make it public.neways i figured out a way out by using arrays and running a for loop over it..works just the way i wanted wish there was a obvious way to do things in Ruby..its concise but it is cumbersome -- Posted via http://www.ruby-forum.com/.