R
RichardOnRails
Hi,
I put together to exercise simple Ruby constructs. It's posted at
http://www.pastie.org/237288.
Before I introduced the "indx" variable it worked fine. The statement
incrementing indx in the def causes the error:
undefined method `+' for nil:NilClass (NoMethodError)
I'm running:
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Why doesn't the def use the instance of indx defined before the def?
Thanks in Advance,
Richard
I put together to exercise simple Ruby constructs. It's posted at
http://www.pastie.org/237288.
Before I introduced the "indx" variable it worked fine. The statement
incrementing indx in the def causes the error:
undefined method `+' for nil:NilClass (NoMethodError)
I'm running:
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Why doesn't the def use the instance of indx defined before the def?
Thanks in Advance,
Richard