Working with AutoCAD entities
Bit encoded Data (cont.)
- You can use this to test to see if any particular bit is set, so to test if the 3rd bit (or the 8 bit) is set in the value assigned to the variable FLG,
- (= 8 (logand 8 FLG)) will return true if it is on, and false if it is off
- You can use this to test multiple cases, i.e. to check to see if both the 1st (2 bit) and the 4th (16 bit) are on
- (= 18 (logand 18 FLG)) will return true on if BOTH the 2 bit and the 16 bit are on