A
AMDRIT
Gang,
I always get confused when it comes to 1's and 0's. I would like to perform
a bitwise operation on a value based on checked boxes.
Am I doing this right?
assuming TurmsRemote.Weekdays has values of
Monday =2
Tuesday =4
Wednesday =8
Thursday = 16
Friday =32
Saturday = 64
Sunday = 128
Sub Monday_Click(Sender, E)
dim chkbox as checkbox = ctype(sender, checkbox)
If chkbox.Checked Then
If Not Me.WeeklyDays And TurmsRemote.Weekdays.Monday Then
Me.WeeklyDays = Me.WeeklyDays And TurmsRemote.Weekdays.Monday
End If
Else
If Me.WeeklyDays And TurmsRemote.Weekdays.Monday Then
Me.WeeklyDays = Me.WeeklyDays - TurmsRemote.Weekdays.Monday
End If
End If
End Sub
I always get confused when it comes to 1's and 0's. I would like to perform
a bitwise operation on a value based on checked boxes.
Am I doing this right?
assuming TurmsRemote.Weekdays has values of
Monday =2
Tuesday =4
Wednesday =8
Thursday = 16
Friday =32
Saturday = 64
Sunday = 128
Sub Monday_Click(Sender, E)
dim chkbox as checkbox = ctype(sender, checkbox)
If chkbox.Checked Then
If Not Me.WeeklyDays And TurmsRemote.Weekdays.Monday Then
Me.WeeklyDays = Me.WeeklyDays And TurmsRemote.Weekdays.Monday
End If
Else
If Me.WeeklyDays And TurmsRemote.Weekdays.Monday Then
Me.WeeklyDays = Me.WeeklyDays - TurmsRemote.Weekdays.Monday
End If
End If
End Sub