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 / DBPro recognizes PLANE as a keyword?

Author
Message
Eminent
13
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 31st Aug 2010 01:15
I made this code snippet for a simple RTS I want to make. It says that there is a Syntax error but does not highlight anything. But when I replace the word PLANE with AIRCRAFT, it works.
Using the word PLANE:

Replaced with AIRCRAFT:



Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Aug 2010 11:19
That's not a bug. "PLANE" is a reserved word - it's used in the make object plane command which uses the correct spelling of the word (actually it's debatable whether either word is correct - make object rectangle would have been far better). DBPro still supports the wrong spelling in the alternative version of the command make object plain which most people still use (including me).

The compiler correctly detects that you've used a reserved word or command. I get the following error message in the Output window when I compile your code:

"Constant name 'PLANE' cannot share the name of a reserved word or command."
Eminent
13
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 31st Aug 2010 18:48
Ohhh.


BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 1st Sep 2010 01:50
But why is simply the word PLANE reserved? Shouldn't it just be the entire phrase MAKE OBJECT PLANE, just as MAKE and OBJECT aren't reserved words?


Latest progress: Fog of War implemented; frustrated by pathfinding >.>
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Sep 2010 13:24
Good question.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 1st Sep 2010 14:12 Edited at: 1st Sep 2010 14:14
object and make are reserved words here 0_o

[edit] You can't use any word of any command as a constant. They work fine as variables. Why Lee made it like that I dunno, but has always been far as I know.

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 1st Sep 2010 16:57
Quote: "You can't use any word of any command as a constant. They work fine as variables. Why Lee made it like that I dunno, but has always been far as I know."

Ah, that makes sense, otherwise the compiler would replace the words in the command with the constant value and then fail to recognize the command. That's slightly different from the reserved word error, though.


Latest progress: Fog of War implemented; frustrated by pathfinding >.>
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Sep 2010 22:48
Words are reserved for constants, because constants are implemented as a text replacement.

For example, if you allowed this:


The DBPro compiler would see it like this:


Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 1st Nov 2010 01:13
Ohhhh now that makes sense!

Thanks once again IanM, you really are a great mod!

Clonkex

Making games is easy.....finishing them is a different matter.

Intel Core 2 Duo 2.8Ghz, Nvidia GeForce 9400 GT 512mb, 1gb ram.

Login to post a reply

Server time is: 2024-04-23 12:45:31
Your offset time is: 2024-04-23 12:45:31