Email55555 wrote:
> 
> I am newbie in Ruby, I cannot find the bug on my financial program.
> The question is related to local variable in block.
> Here is a quick example:
> 
> a = 5000
> r = 0.06
> p = 100
> (1..5).each {|i|
>   puts "#{i}\t\#{a}\t#{a*r}\t#{p}" # <-- the #{a} is not print
                ^
                | 
You escape the # sign here, so the #{a} part isn't parsed as an
expression to be interpolated into the string. 
Remove the \ and it should work somewhat better.


-- 
(\[ Kent Dahl ]/)_    _~_    __[ http://www.stud.ntnu.no/~kentda/ ]___/~
 ))\_student_/((  \__d L b__/  NTNU - graduate engineering - 5. year  )
( \__\_?|?_/__/ ) _)Industrial economics and technological management(
 \____/_?_\____/ (____engineering.discipline_=_Computer::Technology___)