Results 1 to 4 of 4

Thread: Enum Question

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Enum Question

    Code:
    	public enum ValidCommands{
    		help, bp, listbp, clearbp, cont, 
    		lv, changelv, source, stov, 
    		sti,  stout, p, halt , ft
    	}
    instead of help, how can I put in '?' without an error?

    so I want this too work ...

    Code:
    	public enum ValidCommands{
    		?, bp, listbp, clearbp, cont, 
    		lv, changelv, source, stov, 
    		sti,  stout, p, halt , ft
    	}

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Enum Question

    You can't. '?' is a reserved character. Why would you want to anyway??
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Enum Question

    you might not know that but Enums are of type byte, short, int or long.
    If you are thinking of using the enum as a string validator it's not gonna work
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Enum Question

    Just use an array to contain the list of valid commands.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width