From: Logan Capaldo Date: 2006-06-17T05:33:28+09:00 Subject: Re: undefined method (noMethodError) On Jun 16, 2006, at 4:25 PM, Parv G wrote: > Stefan Mahlitz wrote: > >> If you want the object to change its content you will have to define >> instance variables. >> >> def initialize >> @col = 'A' >> end >> >> In nextcell you have to change all occurences of 'col' to '@col'. >> >> Stefan > > Thanks Stefan. > > After using the instance variables through out i'm still getting the > same results for both of method class; the variable value is not > changing. > Here's the code: > [snip] Um, that's because you reset @col to 'A' every time you call nextcell. get rid of that line in nextcell