0

I have some code bellow

enum Part ( center,north,south);
......

how can i to prevent from an user to enter a data out of range of this enum group.
I mean if he/she type 3 or 4
Thanks Sergey

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by polo_coins
0

if you are doing it in code, make the method accept an enum value

if you can do that, agree with lizr and validate what is passed in, might want to add an enum value of unknown to your list and use it if an enum isn't valid for the specified int

0

if you are doing it in code, make the method accept an enum value

if you can do that, agree with lizr and validate what is passed in, might want to add an enum value of unknown to your list and use it if an enum isn't valid for the specified int

Thanks I will try it.
Sergey

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.