On 6/7/07, Todd A. Jacobs <tjacobs-sndr-019fdb / codegnome.org> wrote:
>
> I assumed I had to use globals, since otherwise the block would treat
> the counters as local variables, but I have the same problem either way:
> the counters never increase. They still both read zero at the end of the
> script, even though some strategic puts statements show that the file is
> successfully being read.
>
> What newbie mistake am I making now?
>
> --
> "Oh, look: rocks!"
>         -- Doctor Who, "Destiny of the Daleks"
>
>
You don't need global variables.

total = 0
5.times do
total += 1
end

p total # 5

Harry


-- 

A Look into Japanese Ruby List in English
http://www.kakueki.com/