On Tuesday 29 October 2002 22:54, Charles Hixson wrote:
> William Djaja Tjokroaminata wrote:
> >Charles Hixson <charleshixsn / earthlink.net> wrote:
> >>	   result[i]	=	(val / 10).to_f / 100.
> >>	   val	=	(val * @step)	#<<== Here is the error
> >
> >Hi,
> >
> >This is related to Item 14 in the "Things That Newcomers to Ruby Should
> >Know":
> >
> >    http://www.glue.umd.edu/~billtj/ruby.html#dot
> >
> >I guess that although Ruby syntax is in some sense "line based", a lot of
> >things can make Ruby continues to the next line, if the interpreter thinks
> >that the current line is "unfinished".
> >
> >Regards,
> >
> >Bill
>
> That doesn't seem to be what's going on (though it seemed like a good
> guess, until I fully parenthesized it.  The current re-write is:
>             r    =    ((val / 10).to_f )
>             result[i]    =    r / 100. ;        <<==  The error is here
>             val    =    (val * @step)
> which produces the error message:
> C:/Docs/PayScale/rb/paySchedHtml.rb:24: syntax error
>
> Using parentheses instead of  a semicolon doesn't help.

Hi,

Seems to work here (ruby 1.7.3), with "result[i] = r / 100.0" no need for the 
semicolon, but an extra 0 after the dot.

Francois