SA-MP Forums Archive
Question about #define - 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: Question about #define (/showthread.php?tid=663481)



Question about #define - Nathan94 - 02.02.2019

So today I was wondering if it is possible to create a macro "#redefine"? Was thinking something like this:

Код:
#define redefine %0 %1
#if defined %0
	#undef %0
#endif
#define %0 %1
Then I would just have to do:

Код:
#redefine MAX_PLAYERS (50)
Which is actually going to save me from doing this:

Код:
#if defined MAX_PLAYERS
	#undef MAX_PLAYERS
#endif
#define MAX_PLAYERS (50)



Re: Question about #define - GeorgeMcReary - 02.02.2019

I dont think we can define macros. as they are intended for compilers... I could be wrong... dont know.