From: Travis Michel Date: 2006-07-03T22:34:23+09:00 Subject: Re: if problem in loop causing weirdness ------=_Part_37165_27515552.1151933658380 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I suspect that the problem is with the deletion from an array within a loop of that array. Solution: construct a different array such that => if ow != 'no' then new_array.push(x); end; consider the following test. irb(main):013:0> x = [1,2,3,4] => [1, 2, 3, 4] irb(main):014:0> x.each { |ii| irb(main):015:1* print "ii = #{ii}\n" irb(main):016:1> print "x = #{x}\n" irb(main):017:1> x.delete(ii) irb(main):018:1> print "x now = #{x}\n" irb(main):019:1> } ii = 1 x = 1234 x now = 234 ii = 3 x = 234 x now = 24 => [2, 4] While this does not demonstrate your issue persay, it does however illustrate a bug. ii never equals the value of the original second index, because the array's iterator does not go back a step on deletion. Hope this helps. -trav -- p [151,40,154,157,166,145,40,162,165,142,171].collect { |ii| eval '"\\'+ii.to_s+'"' }.join ------=_Part_37165_27515552.1151933658380--