-1

I have a script that is throwing this error.

This usually means there is a loop (like an if or do) that is not correctly ended, or there are too many end clauses. I can't find the issue. Any good tips on how to identify this kind of syntax error?

It could also be a double-quote issue. Wondering if there is a way (in ultra-edit or text editor) to detect lines of script that have un-even numbers of double quotes.

sawa
  • 165,429
  • 45
  • 277
  • 381
missscripty
  • 529
  • 2
  • 11
  • 30
  • 4
    Well, the first tip is to post your code. You will get zero help troubleshooting a piece of code no one can see. – Beartech Mar 11 '15 at 17:02
  • 2
    Comment out some lines so that the code runs, start removing commented lines until it breaks. If you still can't find it, post your code. – Godwin Mar 11 '15 at 17:03
  • 1
    If you use good indentation, it's usually fairly easy to look up and down and make sure all of your loops have and `end` – dwenzel Mar 11 '15 at 17:04
  • 1
    Or use a good code editor, it will flag many problems for you. – Beartech Mar 11 '15 at 17:12
  • I do use proper indentation and I use ultra edit. My eyes just couldn't see the issue lol – missscripty Mar 11 '15 at 18:43

3 Answers3

3

In answer to: "It could also be a double-quote issue, possibly. Wondering if there is a way to detect any lines of script (in ultra-edit or text editor) where there are an un-even number of double quotes."

Sublime is a great editor that is available for most platforms.

Beartech
  • 6,173
  • 1
  • 18
  • 41
1

For the first question, comment out blocks of code using =begin ... =end and/or # ... and narrow down the error.

For the second question, use syntax highlighting on the text editor. You can easily tell how long a single string literal is continued, and find unbalanced quotes.

sawa
  • 165,429
  • 45
  • 277
  • 381
-1

Never mind, I found the issue. I commented out the newest definition that I had added and it ran. That let me know it was that definition. I then took that out and went through it with a darn comb. Found that I was checking a value, but hadn't allowed for it to be nil or empty. Added that in and now I'm good.

missscripty
  • 529
  • 2
  • 11
  • 30
  • 1
    Forgetting to check a case in a conditional is a semantic error and cannot possibly introduce a `SyntaxError`, so including that case cannot possibly fix it, or at least only accidentally. – Jörg W Mittag Mar 12 '15 at 06:59