From: Dave Burt Date: 2006-02-23T18:50:04+09:00 Subject: Re: setting nil to zero Robert Klemme wrote: > Botp wrote: >> f[w] += 1 >> end > > .... and if f is not a Hash you can do > > f[w] = (f[w] || 0) + 1 > You want an integer from Mr. Nil? Just ask him. f[w] = f[w].to_i + 1 Cheers, Dave -- Posted via http://www.ruby-forum.com/.