Line numbers and better syntax error messages

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Line numbers and better syntax error messages

Post by Rado1 »

Especially for long scripts, it would be helpful to have line numbers in code editor and enhancing syntax error messages by references to the line numbers where problems occurred.

Some of my scripts are about 400 lines and it is very difficult to find bugs there if error messages say only "invalid Primary" or "invalid Expr".
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Yes, the error messages are a mess. I try to fix them in the compiler whenever I get one of those myself. At least there does not seem to be any crashes left, previously you could get "access violation" on certain syntax errors.

Line numbers are a good idea, should be easy to add a label that shows the current line and column.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi Ville,

could you please add line/column also to the "Assignment destination must be variable or array" syntax error message? I wrote a longer script this morning and could not find the place where the problem was. After many commenting and uncommenting of code blocks, I finally found that instead of == I used = for comparison.
User avatar
jonaspm
Posts: 89
Joined: Fri Jul 06, 2012 3:51 pm
Contact:

Post by jonaspm »

+1 :)
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

One that always confuses me is the error that appears when a Condition component tries to process something like this:

Code: Select all

return ((A == 99) (B == 66));
//originally there was a "&&" (or "||") between the two conditions,
//but it got lost during editing...
it returns a scary sounding
Assertion failure (C:\Data\Delphi32\ZzDC_Public\tools\ZDesigner\Compiler\Zc.PAS, line 1835) (line: 4, col: 16) (what does it mean?)
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Thanks, I've improved that error message for next update.
Post Reply