Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Greetings, one short troubleshooting please  RSS feed

 
Thomas Feltzon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently, I was engaged in Java programming, about a day ago. I was getting a hang of it, since I've experienced some C++ before(I dunno, a couple of years back; barely remember how it goes), and it was somehow similar to Java. So I started playing a bit, doing some codes and other bits. And so I tried to create a script, a very short one. However, I could not get it running due to Parsing error; I didn't finish it right. I just need a quick troubleshoot from a professional/expert/vet/etc..

 
Tim Moores
Saloon Keeper
Posts: 3882
91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future, please post any error messages you get along with the code, so that folks here know exactly what you're struggling with.

The parentheses are not balanced - there's one too few closing braces. If you fix that you'll find more issues, but the error messages for those should be pretty self-explanatory.
 
Thomas Feltzon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why thanks. Maybe doing lines 14-28 should do the trick.
 
Fred Kleinschmidt
Bartender
Posts: 560
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possibly also too few open braces. The indentation after line 18 belies what will actually happen..
 
Campbell Ritchie
Marshal
Posts: 55681
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Have a look at our suggestions about indenting. If you indent your code correctly, then you will be able to see whether the {} are correctly paired.
 
Campbell Ritchie
Marshal
Posts: 55681
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also don't write such long lines; they are very difficult to read. I have corrected your post so you can see how to do it.
Minor point: avoid \n: this link tells you what to use instead.
 
Thomas Feltzon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for the help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!