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.

DarkBASIC Professional Discussion / Syntax error on first line, which is a comment?

Author
Message
JamesWalker101
16
Years of Service
User Offline
Joined: 14th Apr 2010
Location: England
Posted: 10th Oct 2012 19:54
Hello, I have recently started getting syntax errors on the first line, which is


I tried replacing it with ', and REM, but i get the same result.
I even tried deleting it, but I still get "Compilation Failed (Syntax Errors)".

My first few lines of code is


I was just adding gravity and collisions for this First person game and this happened. A fresh install of dbpro doesnt help.
Virtual Nomad
Moderator
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 11th Oct 2012 06:13 Edited at: 11th Oct 2012 06:39
first, i'd avoid the using // vs REM or ' for no particular reason other than i rarely (if ever) see others using it and you might have stumbled across a bug that's gone un-detected.

Quote: "A fresh install of dbpro doesnt help. "

have you upgraded to the latest version of dbpro?
http://www.thegamecreators.com/?m=view_product&id=2000&page=upgrade7-62

the latest release candidate can be found here (which appears to be very stable at this point):
http://forum.thegamecreators.com/?m=forum_view&t=180294&b=1

and, which IDE are you using?

(or something else?)

Virtual Nomad @ California, USA . DBPro V7.7
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Oct 2012 12:58
The code snippet compiles fine for me. I'd suggest updating as well. Comments were badly handled in some earlier versions.

If that fails I can only suggest uninstalling followed by reinstalling.

Do other programs compile OK - or only ones without comments?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Oct 2012 13:46
Often... you simply copy the code out of that dba file... remove it from the folder and create a new one and hey presto magic... but it could also be an old edition of the IDEE/Compiler...

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Oct 2012 16:58 Edited at: 11th Oct 2012 16:59
Good suggestion. I recall that working for me once. I suspect a stray invisible character sometimes gets in the file and throws the compiler.

[Edited typo - couldn't resist.]
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 11th Oct 2012 17:09
Quote: "I was just adding gravity and collisions for this First person game and this happened."


Was this in an extra code file? I ask because the other likely cause I can think of for this would be that, if you have multiple code files (includes), they get pulled in at the top of your code and, as I recall, the old IDE reported errors in these included files as line 1 (where they were being included).


Previously TEH_CODERER.
JamesWalker101
16
Years of Service
User Offline
Joined: 14th Apr 2010
Location: England
Posted: 11th Oct 2012 19:14
First of all, I downloaded the DBpro only two weeks ago, and I tried uninstalling and reinstalling. I am buying Dark Game Studio soon. It does seem to be an invisible character, since it selects one invisible letter at the beginning of line 1. I will copy line 2 onwards and paste it into a new project now. Will edit this post when done. Thanks for help guys.
JamesWalker101
16
Years of Service
User Offline
Joined: 14th Apr 2010
Location: England
Posted: 11th Oct 2012 19:17
Yes, it was an invisible character. Thanks guys, and hope this helps for anyone else experiencing this problem. Also, I don't really understand the first reply. Should I use Rem, //, or '?
mistsnake
16
Years of Service
User Offline
Joined: 24th Apr 2010
Location: Inside the matrix
Posted: 11th Oct 2012 23:30
if you're up to date with latest dbp, its your choice what to use, rem is the traditional basic method of commenting

Login to post a reply

Server time is: 2026-07-07 21:09:53
Your offset time is: 2026-07-07 21:09:53