From: Michael Sc Date: 2007-02-12T20:05:01+09:00 Subject: embedding if statements in upto function.(newbie question) Thank you to everyone for all of your help. I was trying to use upto to go through an array of arrays while using if statments. Could anyone enlighten me on what I am doing wrong with the if statements? I am sure it is something easy. I tried this: 0.upto( a.size-2 ) {|i| if (a[i][2]==a[i+1][2] and a[i][0]==a[i+1][0]) then print { (a[i+1][3] - a[i][3]) / a[i][3] * 100 } /n else print 0 end} Thanks again for all of the help. Michael -- Posted via http://www.ruby-forum.com/.