BITWISE is for just working on the bits that make up a number. It allows you to store multiple flags in the same number and mask them. It's useful in encryption, search algorithms, etc. You most likely would only really use them in something really complex. The average user probably won't get much use out of them but filePro has the function for those who may need it. A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. It is a fast, simple action directly supported by the processor, and is used to manipulate values for comparisons and calculations.

Version 6.0.00

Sample Code

top:::
::end:
@once::declare candelete(3,.0,g); declare canpop(3,.0,g); declare cansave(3,.0,g):
::candelete="1":
::canpop="2":
::cansave="4":
::declare flags(3,.0,g); flags="0":
:':':
:' set candelete flag:flags=flags ~| candelete;:
:' set canpop flag:flags=flags ~| canpop:
:' set cansave flag:' flags=flags ~| cansave      ' not set:
::end:
@keyp:(flags ~& canpop) eq "0":msgbox "You are not authorized."; end:
::msgbox "Hello!": ::end:
@keys:(flags ~& cansave) eq "0":msgbox "You are not authorized to save."; end:
::msgbox "You can save": ::end:
@keyd:(flags ~& candelete) eq "0":msgbox "You are not authorized to delete."; end:
::msgbox "You can delete": ::end:

Examples

bitwise and (3 ~& 1)
(bin)11 (dec)3
(bin)01 (dec)1
result (bin)01 (dec)1

bitwise or (3 ~| 1)
(bin)11 (dec)3
(bin)01 (dec)1
result (bin)11 (dec)3

bitwise xor (3 ~^ 1)
(bin)11 (dec)3
(bin)01 (dec)1
result (bin)10 (dec)2

right shift (3 ~> 1)
(bin)11 (dec)3
result (bin)01 (dec)1

left shift (3 ~< 1)
(bin)11 (dec)3
result (bin)10 (dec)2