Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need algorithm
Message
 
 
To
07/07/2011 10:31:53
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Games
Category:
Trivia
Title:
Miscellaneous
Thread ID:
01517506
Message ID:
01517586
Views:
30
>>What I don't understand is how do you go from bit to number that will be stored in the field. For example, say only the 1st option box is selected. Does it mean that the value of 1 is set to the field? And if Option 1 and 2 are selected, the value of 3 is set to the field? And in case of all three options boxes, the value is 7?
>
>The options have numerical values 1, 2, and 4 assigned (for more than 3 options, use additional powers of 2: 8, 16, etc.). If one bit is set, add the values of the individual bits, e.g. 101(binary) = 4 + 1. To get the combined value:
>
>
>CombinedValue = iif(CheckBox0.Value, 1, 0) + iif(CheckBox1.Value, 2, 0) + iif(CheckBox2.Value, 4, 0)
>* (Assuming you changed the checkbox to a logical type. Otherwise, use iif(CheckBox.Value = 1...))
>
I get it now. Thank you very much!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform