Click here to Skip to main content
15,904,339 members
Home / Discussions / C#
   

C#

 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 7:20
PhilDanger9-Jul-07 7:20 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:12
Shy Agam9-Jul-07 8:12 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 8:20
sitebuilderLuc Pattyn9-Jul-07 8:20 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 8:44
sitebuilderLuc Pattyn9-Jul-07 8:44 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:51
Shy Agam9-Jul-07 8:51 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:06
Martin#9-Jul-07 9:06 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:18
sitebuilderLuc Pattyn9-Jul-07 9:18 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:27
sitebuilderLuc Pattyn9-Jul-07 9:27 
Hi,


Martin# wrote:
So your solution would mean to iterate threw the enum members and do the bit test?


No, my code does not even has to know what all the possible enum values are;
the only thing it is interested in is the fact that they are Flags, not arbitrary
values.

Watch my while-loop carefully, it does not perform an Enum.GetValues()
and it does not iterate over the bits (as in for(int bit=0; bit<32; bit++)...);
it automatically loops a number of times, equal to the number of bits set
in the enum value !

Smile | :)


GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:54
Martin#9-Jul-07 9:54 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 7:17
PhilDanger9-Jul-07 7:17 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:02
Shy Agam9-Jul-07 8:02 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 10:55
PhilDanger9-Jul-07 10:55 
QuestionHow to play at the same time 2 or more sounds Pin
mayhem709-Jul-07 4:58
mayhem709-Jul-07 4:58 
AnswerRe: How to play at the same time 2 or more sounds Pin
mav.northwind9-Jul-07 19:21
mav.northwind9-Jul-07 19:21 
AnswerRe: How to play at the same time 2 or more sounds Pin
Hesham Yassin9-Jul-07 22:38
Hesham Yassin9-Jul-07 22:38 
Questionhow to sort datagridview ? (a numeric field) Pin
cmpeng349-Jul-07 4:53
cmpeng349-Jul-07 4:53 
AnswerRe: how to sort datagridview ? (a numeric field) Pin
velkropie9-Jul-07 6:24
velkropie9-Jul-07 6:24 
AnswerRe: how to sort datagridview ? (a numeric field) Pin
Luc Pattyn9-Jul-07 7:12
sitebuilderLuc Pattyn9-Jul-07 7:12 
QuestionHow do I Marshal Vector using Pinvoke Pin
Subodh Borker9-Jul-07 4:41
Subodh Borker9-Jul-07 4:41 
QuestionCrystal Reports Gurus - need help - please Pin
Rome'9-Jul-07 4:27
Rome'9-Jul-07 4:27 
QuestionUdp client Programming Pin
ramdil9-Jul-07 3:57
ramdil9-Jul-07 3:57 
AnswerRe: Udp client Programming Pin
Jimmanuel9-Jul-07 4:18
Jimmanuel9-Jul-07 4:18 
GeneralRe: Udp client Programming Pin
ramdil9-Jul-07 4:41
ramdil9-Jul-07 4:41 
GeneralRe: Udp client Programming Pin
Jimmanuel9-Jul-07 4:52
Jimmanuel9-Jul-07 4:52 
GeneralRe: Udp client Programming Pin
Luc Pattyn9-Jul-07 5:05
sitebuilderLuc Pattyn9-Jul-07 5:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.