SA-MP Forums Archive
Its difference using capital letters or not in Enum? - 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: Its difference using capital letters or not in Enum? (/showthread.php?tid=657291)



Its difference using capital letters or not in Enum? - R3SpaWn0 - 04.08.2018

I dont know if use this:

PHP код:
enum infoWeed
{
    
Created,
    
IdMaria,
    
Sec,
    
Min,
    
Hour,
    
Float:pX,
    
Float:pY,
    
Float:pZ,
    
Plantby[24],
    
Status,
    
Text3D:Label,
    
ObjectID,
};
new 
WeedInfo[MAX_PLANTS][infoWeed
or this: (becouse ii seee in other scripts doing this)

[PHP]

PHP код:
enum infoWeed
{
    
createD,
    
idMaria,
    
sec,
    
min,
    
hour,
    
Float:pX,
    
Float:pY,
    
Float:pZ,
    
Plantby[24],
    
status,
    
Text3D:Label,
    
objectID,
}; 
i can use the 2 forms?


Re: Its difference using capital letters or not in Enum? - BornHuman - 04.08.2018

There is no difference in using capitals or lowercase.


Re: Its difference using capital letters or not in Enum? - RogueDrifter - 04.08.2018

Everything is case sensitive so don't cripple yourself using creAtED when you can write Created instead.


Re: Its difference using capital letters or not in Enum? - R3SpaWn0 - 04.08.2018

Thank you all , nice info learned something new


Re: Its difference using capital letters or not in Enum? - Dayrion - 04.08.2018

Quote:
Originally Posted by ******
Посмотреть сообщение
There is no difference, but there are conventions. So best is something like:

Код:
enum E_WHATEVER
{
    E_WHATEVER_ONE, 
    E_WHATEVER_TWO,
    E_WHATEVER_THREE,
}
This keeps enum symbols associated with the enum they came from, and avoids name collisions - since a variable can't have the same name as an enum element or a function, so it is good to use different styles for them all.
Variables in enumeration need to be in capital letters with as prefix, the enumeration's name?