B
BobRoyAce
I have a third party user control that contains 7 checkedits, one for
each day of the week. It stores which days are checked as an integer
by adding up the values for each day checked, using the following
values:
SUN 1
MON 2
TUE 4
WED 8
THU 16
FRI 32
SAT 64
So, for example, if TUE, WED, & THU are the only days checked, it
stores a value of 28. If FRI, SAT, & SUN only, it stores a value of
97.
How can I interrogate the integer value to know if a particular day
was checked? In other words, if I knew that the integer value was 28,
what calculation/operation would I perform on that number to determine
that, yes, it does indicate that THU was checked? Or, if the value was
96, I could determine that no, THU was not checked?
each day of the week. It stores which days are checked as an integer
by adding up the values for each day checked, using the following
values:
SUN 1
MON 2
TUE 4
WED 8
THU 16
FRI 32
SAT 64
So, for example, if TUE, WED, & THU are the only days checked, it
stores a value of 28. If FRI, SAT, & SUN only, it stores a value of
97.
How can I interrogate the integer value to know if a particular day
was checked? In other words, if I knew that the integer value was 28,
what calculation/operation would I perform on that number to determine
that, yes, it does indicate that THU was checked? Or, if the value was
96, I could determine that no, THU was not checked?