with :
array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0]

I wrote :
array.index(array.detect {|x| x > 0})    => 15

is there a better and simpler way to do it ?
thanks

joss