Raised This Month: $ Target: $400
 0% 

ENUM :O


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
--kml--
Senior Member
Join Date: Jan 2009
Old 05-29-2009 , 08:47   ENUM :O
Reply With Quote #1

ENUM :O


well i am confused with the enum
can explain the use and what it is


Quote:
and yes i've use the search button and came with 500 threads.
but didnt found any explanation .
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2009 , 09:12   Re: ENUM :O
Reply With Quote #2

Many features\elements of Small are not exclusive to the language. If you are ever unsure of anything and cannot find it in an AMX-X search, don't hesitate to try Google. This will 9 out of 10 times answer your question as long as you are not searching something related to the functions/systems used in HL scripting. In this particular case, enum is widely used in many programming languages so you will get many hits when you search the web.

http://en.wikipedia.org/wiki/Enumerated_type
http://www.cprogramming.com/tutorial/enum.html
http://java.sun.com/docs/books/tutor...vaOO/enum.html
__________________
Bugsy is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-29-2009 , 09:30   Re: ENUM :O
Reply With Quote #3

i've click 3 of those.
didnt even understand LOL
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2009 , 09:42   Re: ENUM :O
Reply With Quote #4

You clicked them but did you actually read and try to absorb what they say? You can't expect to be spoon-fed if you are trying to learn how to program on your own (no schooling\books).
__________________
Bugsy is offline
BFK_GoNER
Junior Member
Join Date: Feb 2009
Location: Holland
Old 05-31-2009 , 11:11   Re: ENUM :O
Reply With Quote #5

For instance, you want to define a set of constants belonging to the same group. You could do it this way:

PHP Code:
// Weapon constants:
#define WEAPON_KNIFE     10
#define WEAPON_DEAGLE   20
#define WEAPON_AK47      30
#define WEAPON_AWP       40
#define WEAPON_FLASH    50 
or you could use enum:

PHP Code:
enum (+=10)
{
      
WEAPON_KNIFE 10,
      
WEAPON_DEAGLE,     // will be equal to 20
      
WEAPON_AK47,        // will be equal to 30
      
WEAPON_AWP,        // ... and so on
      
WEAPON_FLASH       // ...

BFK_GoNER is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode