From: "David A. Black" Date: 2008-08-27T21:58:16+09:00 Subject: Re: syntax error, unexpected kELSE Hi -- On Wed, 27 Aug 2008, Chris Bailey wrote: > I've been trying to solve the problem in the following bit of code for > quite some time now with no luck. The unexpected kELSE error is occuring > in the commented line. $map is a multi-dimensional array and the > makeshift iterator works properly without the if/else statement. Any > ideas? > > def pmap > input = gets.downcase.chomp > if input == "exit" > $plrObj.save > puts "Exiting..." > $running = false > else > buf = "" > z = 0 > $map.each do |x| > x.each do |y| > if z < 5 > buf = buf + y.to_s > z++ There's no ++ increment operator. Change that to z += 1. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL See http://www.rubypal.com for details and updates!