I see const (lowercase) is recognised in the editor color coding. I assume for inline C? Any chance of having a GLB version too?
For example
INLINE
const int xorigin = 320;
const int yorigin = 240;
ENDINLINE
But I'd like (or somegthing similar)
CONST xorigin = 320
CONST yorigin = 240
So I can define my global constants somewhere (or even local ones in functions) rather than waste memory on variables.
I've got it on my WIP list.
cool. Thanks Gernot.
BTW, I thought about using some constants for the key codes, coming from the Blitz world these constants are quite familiar and readable in the code. If I put these in the main file:
INLINE
const int KEY_ESCAPE=1;
const int KEY_1=2;
const int KEY_2=3;
const int KEY_3=4;
const int KEY_4=5;
const int KEY_5=6;
const int KEY_6=7;
const int KEY_7=8;
const int KEY_8=9;
const int KEY_9=10;
const int KEY_0=11;
ENDINLINE
I can refer to them in that same file. If I try to refer to them in any other file in my project they do not exist. Likewise if I define them in another file in my project I can not access them. Is there anyway to make these constants global to the entire program?
There's already a solution for that with a TYPE. Ah here it is:
http://www.glbasic.com/forum/viewtopic.php?id=679
That's a great solution Gernot. Thanks! You should add a category to the built in help to contain useful code snippets such as this :)