|
-
May 8th, 2007, 12:37 AM
#1
Thread Starter
Hyperactive Member
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
}
-
May 9th, 2007, 08:22 AM
#2
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
-
May 9th, 2007, 03:58 PM
#3
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
-
May 11th, 2007, 04:45 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|