[_: TAG] Help
#1

Good evening everyone,

While I was searching for a way to loop through enum element, I ended up using this which worked out just fine

PHP Code:

for(new i_:i<sizeof(AchievementName);i++){
    if(
pAch[playerid][E_Achievements:i] == 1){
        
format(strsizeof(str), "%s{00FF00}%s\n",strAchievementName[i]);
    }  
    else 
format(strsizeof(str), "%s{FF0000}%s\n",strAchievementName[i]);    

My question is, what is the name of this tag "_:", I tried googeling it for extra exemples, but I couldn't find its name, so could anyone care to tell me what it's called?
Reply
#2

That is anonymous tag. Basically its default and it means NO TAG.
Tags are usually used to "tag" some functions return types and accepting arguments.

For example streamer has been using them lately to avoid confusion, and default Float is actually a tag.
In your case new i; by default has _: tag (or not tag at all). While AchievementName probably belong to some enum and that enum name is actually a tag for it. You added that anonymous tag ( _: ) in front of AchievementName to suppress warnings (you basically told compiler, its ok i know what im doing, dont complain please.
Reply
#3

I call it "detag".

It removes the tags on the variable, that's why.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)