Just updated to 7.089 and now my code which ran well under 7.087 fails with syntax errors. if fails to compile CONST declarations. Did something change?
[EDIT] whats strange is that const is still highlighted as a reserved word in the IDE, but instead of being in capitals it always reverts to lowercase.
Cheers,
Unc
Change it to CONSTANT. It's still a command in progress.
The CONST command is reserved for future expansion and currently wont work.
Yep that fixed it. Thanks guys. Shame I used const throughout most of the programs I have written so far :S Find and replace here I come :)
No, if you use CONSTANT, and it compiles, you can be happy.
But there are occasions where it won't compile!
Aha, CONSTANT instead of CONST.. I was wondering why that didn't work :) I had the same problem, I had already created a program with the demo version but in a newer version it didn't compile because of the CONST' s. I use it a lot for defining things like "direction-enumeration" and gameobjects, for example.
CONSTANT DIR_UP = 1
CONSTANT DIR_DOWN = 2
// etc.
CONSTANT GAMEOBJ_NONE = 0
CONSTANT GAMEOBJ_WALL = 1
CONSTANT GAMEOBJ_LADDER = 2
// etc.
I assume GLBasic translates that to #defines in the C++ files, right?
#DEFINE GAMEOBJ_NONE = 0
#DEFINE GAMEOBJ_WALL = 1
#DEFINE GAMEOBJ_LADDER = 2
// etc.
Occasionally it won't compile? Do you mean when there is a naming conflict or something? For example, when you use a CONSTANT with the same name as a global/local variable or as a function name?
CONSTANT will b converted to "const DGNat xy = 1;"