2014-09-15 22:51:21

Hi all,
So I got the following error report when running my script and don't know what to make of it, really because I don't know which lines it's referring to. The braces seem to be in the right spots, so I don't know why I get a "Unexpected end of file". Is it scanning backwards?

Here's the error in question. I suppose you'd need my code to help, but I'm trying to figure it out. This ignores comments? So therefore the error might not actually be line 10.


File: C:\BGTStuff\Memory Train Deluxe\Memory Train Deluxe.bgt
On line: 43 (2)
Line: }
Error: Unexpected end of file

File: C:\BGTStuff\Memory Train Deluxe\Memory Train Deluxe.bgt
On line: 10 (1)
Information: While parsing statement block

2014-09-15 23:39:26

nah, it doesn't ignore comments. YOu cfrgot to close a brace somewhere, most likely. It could be something else like a parentheses or quote though, but that's highly doubtful.

I like to sleep, Sleep is good,
This is how I do it: Lie on a nice warm cozy bed, and dream dreams about how to rule the world!
Follow @TheGreatAthlon5 on twitter for humorous facts and game updates!
If you like my posts, thumb me up!

2014-09-16 11:44:21

That is the most annoying error ever, and the compiler can't make it any easier.
My general strategy has always been:

  • Use this matcher program to try and determine what exactly is broken.

  • Copy everything into a temporary file (I just save it as debug.txt), and start cutting sections* and running the matcher until I've isolated the block with hte error.

  • Then, it's usually easier to find, and a simple ctrl+f and paste will let me find it in the original file.

* But cutting blocks is a bit tricky if you need to search inside a large function. Only do one at a time if possible; the idea is something like binary search, where either the error was in the block you cut, or the part that was left behind, so when you find out you can still have it on your clipboard if you need it.

That sounded way more complicated than it was supposed to. sad
Try the matcher and see if it helps?

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2014-09-16 17:06:03

Learning to indent can help a lot with this kind of thing in future.  Not now, unfortunately, not unless you've got an auto-indenter, but in future.  If you get to the bottom of the file or the end of a function and aren't back at level 0 then you know where there's a missing brace.
It's good practice anyway; sighted coders will be derogatory at best if you don't, and it does have some other nice advantages.

My Blog
Twitter: @ajhicks1992