19.03.2013, 11:44
Is there any possiblity of using a double-enum tag (I will provide an example below) without getting a tag mismatch error AND without having to put _: to clear it?
It's quite a stupid question as it is asked out of lazyness, but I'm just wondering.
Say you have a code like this:
I would then like to use it like this:
EDIT: I misspoke. That code above does NOT give me a warning, but if I try to print the data, then I do. I would like to be able to print out the value and use it as an integer, kind of.
Because of lazyness, I would like to not having to do so, but still don't get a tag mismatch warning.
I tried making a macro for it as a last resort (see below), but that crashed my compiler.
I also tried another way of doing it, by calling the variable something really... weird, then make a macro called MyVar to "mimic" that variable, but when I then assigned that variable I got another warning saying that the tag was being hidden:
Any help would be appreciated!
It's quite a stupid question as it is asked out of lazyness, but I'm just wondering.
Say you have a code like this:
pawn Код:
enum E_MY_ENUM
{
E_DATA1,
E_DATA2
};
enum E_MY_2ND_ENUM
{
E_MY_ENUM:E2_DATA1,
E2_DATA2
};
new
MyVar[ E_MY_2ND_ENUM ]
;
pawn Код:
MyVar[ E2_DATA1 ] = E_DATA2;
Because of lazyness, I would like to not having to do so, but still don't get a tag mismatch warning.
I tried making a macro for it as a last resort (see below), but that crashed my compiler.
pawn Код:
#define MyVar _:MyVar
pawn Код:
#define MyVar _:TESTVARIABLEIWILLNEVERUSETHENAMEOF
MyVar[ E2_DATA1 ] = E_DATA1;
Код:
warning 221: label name "_" shadows tag name