Posts: 2,197
Threads: 25
Joined: Apr 2011
Reputation:
0
Could you explain again ?
Posts: 568
Threads: 92
Joined: Sep 2009
Reputation:
0
I think he's trying to say that if he can put 2 defines in 1 but i think thats not possible.
Posts: 1,046
Threads: 29
Joined: Mar 2010
Quote:
Originally Posted by Scottas
There are any way to use defines in define? For example:
pawn Код:
#define one #if !defined two #error...
So in that way, I could check entered parameters doesn't dublicated for some setup functions during compile time. Or there are any other way to do this?
|
Yes it is
Examples:
pawn Код:
#define RED 0xFF0000FF
#define invalidid SendClientMessage(playerid, RED, "This Player ID is not connected.");
pawn Код:
#define SetVehicleNumberPlateF(%0,%1,%2); UseBrackets\
{\
new formatstring[32];\
format(formatstring,sizeof(formatstring),%1,%2);\
SetVehicleNumberPlate(%0,formatstring);\
}
#define UseBrackets if(negative != positive)
new bool:negative = false, bool:positive = true;
As you can see that I've used defines inside the defines.
But if you write the same define text into it's own define so the compiler will crash.
Example:
pawn Код:
#define fail_defined_variable fail_defined_variable //It loops around and there is no end
new fail_defined_variable;
In the worst case after compiling it you have to close pawncc.exe from taskmanager.
Posts: 333
Threads: 18
Joined: Jul 2010
Reputation:
0
I am trying to add a field into sqlite database, and instead of getting table info and checking if field already exists, I want make something what I've tried to explane.
Nero, thanks. I haven't thought about this.