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 / Couldn't Understand Command

Author
Message
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 30th Nov 2010 23:12 Edited at: 30th Nov 2010 23:15
I'm having a bit of a problem with compiling source for my project... I keep getting a "Compilation Failed. Could not understand command at line x" error every time I compile, around line 443. I've tried using various editors, and found the code that the compiler is having trouble with, which is a simple variable assignment.
This is the area of code (Line 443 is the blank line in the middle):



It also keeps stopping on this specific command:


Anyone know a solution for this? I haven't installed any new plugins or updates, so I don't know why this is happening now.


Virtual Nomad
Moderator
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Nov 2010 23:40
my only guess is a reserved word issue near the suspect line because i don't trust the compiler, etc, enough to be 100% perfect. i don't write a lot of code but i've always avoided using words like Sprite, Object, Image that are or are part of DBPro commands for variable names, instead using things like Spr, Obj, Img. it's worth a shot/hope it helps

Virtual Nomad @ California, USA . DBPro V7.5
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
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 30th Nov 2010 23:44
Hm, that's a good theory, but I'm sure that wouldn't be it because all my variables and functions are prefixed with the module names.


=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 1st Dec 2010 00:28
It's because of the massive spaces!

= FAIL

= Compiles OK

Hope that helps.

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 1st Dec 2010 00:36 Edited at: 1st Dec 2010 02:37
Hm... Having spaces has always worked fine before...that's really odd,!
I used those extra spaces because I think it's cleaner to have all the equal signs line up... I'm a total perfectionist.
I tend to use space and tab interchangeably, maybe that's the problem.

[Edit] Wow, actually, I found this:

Works.
Doesn't.


GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 1st Dec 2010 05:24
I think your problem is the tabs. If you replace the tabs with just a bunch of spaces it should work...

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 1st Dec 2010 05:49 Edited at: 1st Dec 2010 05:50
yah, you cant use "reserved words" (i think they are called) as variable names. when i put say image as a variable name, i put something like image0 or imageo, just something to make it a bit different.

Behold the new marble game coming soon: Marbsticle Course>>>http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0

Login to post a reply

Server time is: 2026-07-21 13:38:45
Your offset time is: 2026-07-21 13:38:45