Quote: "For example, the following accepts "player" but not "next""
The word “player” is not actually a reserved word in the DBPro language.
This is why DBPro compiler allows you to declare; variables, arrays, user defined data types, and functions by the name “player”.
The reason why constants can not be declared by the name “player”, “enemy”, or any other word which appears in a DBPro command is due to the method by which the DBPro pre-compiler for constants performs the text replacement.
As IanM has already pointed out, when the pre-compiler processes a line of code it simply performs a search for all instances of the name of a constant in the line of code. The problem is that the pre-compiler does not verify that an instance of the name of a constant is in fact an actual reference to a constant and not a word within a DBPro command. The pre-compiler for constants should parse out all DBPro commands in the line of code and then parse out the names of constants. The lack of this verification step is why the DBPro compiler has to treat the word “player” and “enemy” as a reserved word when handling constants.
[img]
[/img]
WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.