Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / Incorrect line numbers reported - Example and Solution!!!!!

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Mar 2006 14:32 Edited at: 27th Mar 2006 14:33
<TRUMPET BLAST>
Yes, it's back. But this time I have a very simple example...and the answer! Let's hope there is a way to fix the compiler...



This will report an error at line 34, when the error is in fact at line 37.
How do you fix it? You remove comments between remstart / remend operands.

So I guess the compiler is ignoring block comments when adding up the lines.

</TRUMPET BLAST>

Miguel Melo
18
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 27th Mar 2006 14:38
I have also noticed that the compiler seems to count lines across files, so it will say something like "unknown object at line 1500" when none of the files in the project is that long.

I believe it may be adding together all files and line 1500 is actually line 100 on the second file, when the first one is 1400 lines long...

I have vague plans for World Domination
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 27th Mar 2006 15:10
Fixed for U6 beta5:

* Line number error integrity restored when using REMSTART and REMEND in your programs

"Small, smart, and running around the legs of dinosaurs to find enough food to survive, bedroom programmers aren't extinct after all "
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Mar 2006 15:44
That has to be the quickest fix in history - 38 minutes from report to correction!

Not only that, but I estimate that this will save literally hours of bug-hunting.

ALL HAIL!

jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 13th Apr 2008 20:01
I have the same trouble, but I don't understand the cure! Is "U6 beta5" available now as a non-beta? I am using Verion 1.067 of Dark Basic Pro.
Twinsen
17
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 13th Apr 2008 20:11
nope, that was 1.060 beta 5 ... the version you are using now is way since fixed

Could you help me treat my injured Dino-Fly ?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Apr 2008 21:07
Quote: "the version you are using now is way since fixed "


Are you sure? I've noticed that the latest release keeps giving me wrong line numbers for errors - and nearly always when I'm using remstart/remend pairs or other comments for debugging purposes - which makes the bug especially annoying.

This problem is a recent development which makes me think it's U6.7.

Will try to produce an example ... (which seems harder than I expected).
Twinsen
17
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 13th Apr 2008 21:47
hmm I was just suspecting cause there have been 7 updates since then so it SHOULD have been fixed ... but if u say so, then it's still active

Could you help me treat my injured Dino-Fly ?
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 14th Apr 2008 00:54
How did you manage to bump this after more than 2 years?

Unterseeboot - Has you played it?
Los Mineros are on leave...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Apr 2008 01:01
Quote: "How did you manage to bump this after more than 2 years?"


I expect he just posted in the usual way.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 14th Apr 2008 01:06
Fair enough...I though it would have autolocked by then.

On an on-topic note, that is rather strange that this bug is still around when it seems to have been fixed several years ago...

Unterseeboot - Has you played it?
Los Mineros are on leave...
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Apr 2008 11:33 Edited at: 14th Apr 2008 11:34
It probably got reintroduced, rather than never got fixed.

There have been two confirmed ways to screw up the line numbering in the past:

1. REMSTART/REMEND blocks
2. Comments within SELECT/CASE blocks.

It would be useful to know which one is the problem now.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Apr 2008 18:19
Quote: "It would be useful to know which one is the problem now."


Indeed. I think it is connected with the following bug report, but I can't quite produce a simple convincing example (I've only seen it in long programs where the opportunity to have fouled up something else is too great). When I next encounter the bug I'll try to remember to save it and edit it down for this thread.

http://forum.thegamecreators.com/?m=forum_view&t=127818&b=15
Final Epsilon
20
Years of Service
User Offline
Joined: 26th Jan 2004
Location: CA, USA
Posted: 13th Jul 2008 02:29 Edited at: 13th Jul 2008 03:23
The incorrect line reporting was starting to bug me tremendously, so I spent a while and I think I have the problem now. Tested in both 6.8 and the 6.9 trial version



Comments within a select statement but not within a case statement throw off the line reporting. There are only 8 lines in that example but the error is reported at line 10.

Edit: I believe this also corresponds with HowDo's example here: http://forum.thegamecreators.com/?m=forum_view&t=125257&b=15
The offending comment is in the first select block of the code snippet.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Jul 2008 11:08
Great, that has solved one of my issues. I never put comments in a Select block for this reason - now I can

A fix would be nice, a workaround is good enough for now.

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 16th Jul 2008 07:31
hurray! you have no idea how much time i have spent trying to find where errors really occured as opposed to where DBP tells me they occured at no more "error at line X" when there is no code at line X!

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Jul 2008 19:31
It doesn't fix everything, but it fixes a lot. Still haven't worked out what the final piece fo this jigsaw is yet. I have a hunch declaring globals, constants and types in anything other than the main dba fle may be part of the problem.

Login to post a reply

Server time is: 2024-05-04 13:13:34
Your offset time is: 2024-05-04 13:13:34