Version 2.55
I had some defines in the script header:
#define DIALOG 1;
#define LIST 2;
#define OK 3;
#define CANCEL 4;
[Using modified BlueGUI save/load scripts, credit to Rick]
and the functions have if's:
...
if (state == DIALOG) {
blah blah balh...
}
if (state == LIST) {
blah blah blah...
}
etc.
When I tried to complile, it game me error:
... Problem in "Main Script"
(Line blah) Error in expr near '1'
etc.
I changed the "DIALOG" in the if to "1", and the script was compliled.
I had call for the fucntion in interface_click:
if (button == 2) {
Load(DIALOG);
}
It gave the same error on the Load()-call line.
I changed the "DIALOG" to "1", and it worked aswel. The same for all #defined using functions. I can't use the #defines! Argh!
And, the same comes up with v2.56d. Are my game files somehow corrupted, or what is it? I'd like to know if someone knows this problem or even knows how to fix it.
Hey, TK the define directive works the way that it just replace the macro identifier with appropriate string, so:
#define DIALOG 1;
turns out into:
if (button == 2) {
Load(1;); // originally was Load(DIALOG);
}
~Cheers
That goes for the whole line, so don't put a comment on the same line either.
Dammit! Ok... thanks...
Also, watch out for tabs between #define and the symbol. Use spaces instead.
My tabs with MRC room names worked just fine...
Quote from: SteveMcCrea on Sun 07/12/2003 12:42:07
Also, watch out for tabs between #define and the symbol. Use spaces instead.
Same between symbol and definition. Use spaces if you want them nicely aligned.