Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
; turn on the "8" bit flags = flags | 8When used this way, the bit values are always powers of 2, like 0, 1, 2, 4, 8, 16, 32, 64... But that's not very readable, so you often see
; turn on the "power" bit flags = flags | POWERand "POWER" is a variable set to 8 someplace else in the program. By convention, variables like these are often in all UPPERCASE. These operations can be combined thusly:
; turn on light, camera and action flags = flags | LIGHTS | CAMERA | ACTION ;Where | combines bits, & strips away all but certain bits ; get value of camera flag bit value = flags & CAMERA ; test the lights If flags & LIGHTS Then Message("","lights are on")Why, you ask, are the bits always powers of 2? It's all about "binary arithmetic". Do a google search and you'll probly find several decent tutorials. Very handy stuff. Hope this helps.
Article ID: W16021
File Created: 2004:03:30:15:42:26
Last Updated: 2004:03:30:15:42:26