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] compiler does not always detect invalid use of reserved words in constants

Author
Message
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Feb 2009 12:45 Edited at: 2nd Feb 2009 20:59
The following code compiles and runs when it shouldn't:



The correct compiler behaviour occurs with the following code:



A few quick checks show that the following constant variable names are swallowed by the compiler when they shouldn't:




No doubt there are others.

If anyone notices any more I'll add them to this list. I'll also put them in alphabetic order when I next edit this post.

Edit1: added a few more - and put in alphabetic order.
Edit2: added u and v.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Feb 2009 19:29
object position x? Best remove the x, y and z from your list

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Feb 2009 21:29 Edited at: 1st Feb 2009 21:30
Quote: "object position x?"


Precisely. The compiler accepts all three when it shouldn't. As you pointed out in the other thread the compiler will replace all occurrences of x if they are separated by spaces.

Try the following to see what happens with and without the constant declaration. Of course it could the fact that the extra space is allowed when it shouldn't.



Quote: "Best remove the x, y and z from your list"


Nope. I included them without comment deliberately.
Not_Maindric
16
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 2nd Feb 2009 01:36
X VECTOR2
X VECTOR3
X VECTOR4

The X here would change if I am not mistaken.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Feb 2009 12:12
Quote: "The X here would change if I am not mistaken."


Quite right. The compiler chokes on commands such as



when in fact the problem is a declaration such as



I'll be adding more words to my hit list when I get time to check.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Feb 2009 20:58
Just added u and v to the list - for IanM's benefit, of course.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
bfrnhout
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 11th Mar 2009 19:59
Just read the manual on the good way. In there it is explained. Its say. Be carfull by using key words to constants. It can give you a strainge behavouir in the program it self.

That give you th options to use keywords and during compiling you do not get any warnings. Only when it reach that point where you use the keyword on the right way, your program wil act different than what you expect.

Games is live so to live do the games

Login to post a reply

Server time is: 2024-04-26 06:44:57
Your offset time is: 2024-04-26 06:44:57