From: Rimantas Liubertas Date: 2006-10-20T17:26:50+09:00 Subject: Re: filling an array excepted first and last position... > ldom = 30 # variable (last day of a month...) > > # array init to 0 > @obk = [] > 1.step(ldom, 1) do |i| > @obk[i] = 0 > end Why not: @obk = Array.new(ldom,0) > I am filling an array as follows (part of a larger filling scheme) : > ---- > #fiiling the array upon another array content > # but I'd like to AVOID filling the first and last position in this loop.... > obdays.each do |bd| > @obk[bd] = 1 > end <...> Not sure what are you trying to do here, but maybe something like this may suit you? @obk.fill(1,ldom-1){|i| obdays[i]} Regards, Rimantas -- http://rimantas.com/