Yes, the newbie has created a zombie thread
Set operations are done with integers and the Boolean operators.
Some versions of Windows (at least #8) have the Boolean operators as part of the Programmer view.
For anyone who has set DIP switches, it is a similiar process.
Let's say I am programming a hindu astrology program, and I want to test if Saturn.house is either the first house, or the fourth house, or the seventh house, or the tenth house.
It could be done with a tedious series of IF statements, but it would be faster to use integers.
So.....
Take Saturn.house [integer] and deduct 1 from it.
Use that value as the exponent to raise 2 to the exponent.
If Saturn.house is 1 [as first house], 1 minus 1 equals zero, and 2 raised to the zero power is 1. Uh, yeah, nothing as changed.....
Okay, let's say Saturn.house is 7.
7 minus 1 equals 6
2 raised to the sixth power is 64, and that is the seventh bit [when the right-most bit is understood as the first bit].
Okay, we now have 64 assigned to some integer [TestInt, perhaps?]
Let's create the 1,4,7,10 set, we'll call it Kendras, it will be an integer.
1 [2 to the zero power] plus
2 raised to the 3rd [8], plus
2 raised to the 6th [64], plus
2 raised to the 9th [512],
Which is 1+8+64+512=585. As an integer, the binary number will have 4 bits set to one; i.e. the first, fourth, seventh, and tenth bits.
Check my work if you desire, I think I am right
Okay, now that the integers are created, let's perform the Boolean test:
If TestInt AND Kendras >0 then........["Saturn is in Kendras"].
OR will join sets
XOR will test for occupancy in one set, but not both.
NOT is somewhat useless for our needs, I think.
For Now,
Steve