ATVO by Appgineering
Download
Read-only

Script errors in Error List reference wrong line

6 posts 4,636 views Started 03 Mar 2019, 19:42
Showing 1–6 of 6 posts
Paulo B.
Original poster
· edited

Any error from a script in the Error List references one line earlier than where the error occurs.

For example, if the Error List reports "(Line 60) ; expected", there is actually a missing semicolon in Line 61 (according to the numbered lines in the script editor).

Nick Thissen Appgineering
Reply #1

Can you reproduce this in every single script? I'm assuming you mean C# scripts, or is it also in other languages? It may be related to some specific script lines that the compiler somehow doesn't include. Your script is compiled and any errors from that compilation are fed straight to the ATVO error list so we cannot really fix this. It is likely that the compiler is doing some optimization on the code resulting in some lines missing.

If it is literally every single script I can see if I can just add 1 to the line number, but I doubt it...

Paulo B.
Reply #2
· edited

Line count is incorrect in C# and Visual Basic. Line count is correct in JavaScript.

In Phyton and Lua the line number is not shown at all. The standard example code for Ruby didn't compile for me, so I couldn't test it.


Nick Thissen Appgineering
Reply #3

I see. Actually it is not so easy to just add 1 to this because like I said the error comes straight out of the compiler. I'd have to somehow capture that error, parse it and change the line number. It would be quite some work and could introduce bugs so I'd rather leave it like this. I don't think it's a very serious issue, if you know about it you can add 1 yourself and if not you'll probably find out soon enough that you have to look one line further.

In each case I would encourage everyone to use Visual Studio Code to do the scripting anyway as our script editor is not as powerful.

Nick Thissen Appgineering
Reply #5

Thanks to Simon we fixed it, turns out I can just add a blank line to the source before compiling and that will offset the line number to match :)

Archive · Read-only

New replies have moved to Discord.