SA-MP Forums Archive
Pre-processor issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pre-processor issue (/showthread.php?tid=348270)



[SOLVED]Pre-processor issue - Extremo - 04.06.2012

I seem not to understand this issue for the past hours and it makes no sense to me.

Ok, to the example:

pawn Код:
#define NUMBER (0)
#define RANDOM (1)
Then in another file I got this:

pawn Код:
#if defined NUMBER
    #if NUMBER == 0
        #undef NUMBER
        #undef RANDOM
        #define NUMBER (1)
        #define RANDOM (2)
        #endinput
    #elseif NUMBER == 1
       ....
It works just like y_unique from YSI really, except that the defines don't do the same as they do there. The problem is however, no matter how many times I include it it doesn't seem to think "NUMBER" is defined. There is no spelling mistake with it!

I ended up changing the system so that there is only #if NUMBER == 0 etc without any #elseif or #if defined and now it actually increased by 1, while it should have increased by 4. Its really frustrating me and I don't see a reason for it not to work.

I also don't do the mistake that I simply end the input because unique is already included. It makes no sense, please help.