What do you mean? You can't increment it - or, if you can, how do you access the value?
[Aside: I'm not quite sure what you mean by "constant" in this connection. DBPro #constants are a different beast altogether and are nothing more than an instruction to the editor/compiler to replace every occurrence of any #constants by their defining string before doing further compilation. For example, the following snippet
#constant myConst a+1
a = 10
a = myConst
print a
wait key
is first changed to
a = 10
a = a+1
print a
wait key
before syntax checking etc. In other words #constants are simply a device to enable the programmer to use a useful nmemonic in place of a section of code. Nothing to do with constants in the sense of something that can't be changed as the following snippet demonstrates:
#constant myShortVar myReallyLongAndCumbersomeVariableName
myShortVar = 20
inc myShortVar
print myShortVar
wait key
Of course you can use them to replace constant numeric values by a more meaningful verbal description - and those constants can't be changed of course. In fact the following snippet demonstrates this - and coincidentally should also give a compiler error (but doesn't). Is that what you are trying to say?
#constant numEnemies 33
inc numEnemies
print numEnemies
wait key
In other words this particular compiler obscurity affects #constants as well as function calls (and probably other things as well
).
I guess the storage location containing the result of the inc calculation, i.e. 34 in the above snippet, just can't be accessed via standard DBPro commands. The compiler should detect that situation in my opinion. The problem is quite clear if you look at the .dbm file produced by the compiler.
]