From: Randy Coulman Date: 2012-02-07T03:34:32+09:00 Subject: Re: formal argument cannot be a constant --20cf3056396dcb2e9b04b84fe93b Content-Type: text/plain; charset=ISO-8859-1 In Ruby, variable names start with lower-case letters and constants (including class names) start with upper-case letters. You are using an upper-case I for your loop variable, which doesn't follow these rules. Randy On Mon, Feb 6, 2012 at 10:30 AM, Hasmukh Patel wrote: > def display_method(NM) > puts "I am in Display Method #{NM}" > end > > for I in 0..5 > display_method "Testing Ruby MEthod" > if I<2 > break > end > end > > Hi, I am new learner in ruby, and getting error say "formal argument > cannot be a constant" Can any one help me pls? > > Thanks for your help in advance. > > -- > Posted via http://www.ruby-forum.com/. > > -- Randy Coulman rcoulman@gmail.com Twitter: @randycoulman --20cf3056396dcb2e9b04b84fe93b--