View Single Post
  #11  
Old 05-05-2007, 05:31 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Rapidwolve View Post
Enum is useful because it can be used in ways like this:
PHP Code:
enum key{
F9 122,
F10 123,
F11 124
}

function 
onKeyPressed(codekey)
{
  if (
code in {key.F9key.F10key.F11})
    
do_something();

I didn't know it could be used that way, of course I just found out you can make assignments to the enums but that's news to me.

Of course this makes it seem more and more like an array! But easier to remember and such in the fact that it's more so, enumname.stuff rather than array[0].

Can you add things to enumerators through function?
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote