Shiny Language Reference
Language Reference > Bitwise Operators
Bitwise Operators
bitor
bitand
bitnot
bitxor
Bitwise Operators
Bitwise operators are used to manipulate individual bits of data in a dword value. There are 4 bitwise operators. Shiny supports dual syntax for all bitwise operators, using the familiar C syntax.
VB-like C-like Meaning bitand & Bitwise AND bitor | Bitwise OR bitnot ~ Bitwise NOT bitxor ^ Bitwise XOR (Exclusive OR)
Examples
// Perform bitwise AND on value of Dword2 and Dword2, store in Result
dword Result = Dword1 bitand Dword2;
// Perform same bitwise AND operation using C-like syntax
dword Result = Dword1 & Dword2;
// Perform bitwise OR with Dword1 and 0x00000001
dword Result = Dword1 bitor 0x00000001;
// Perform same bitwise OR using C-like syntax
dword Result = Dword1 | 0x00000001;
// Perform bitwise NOT with 2 DWORDs
dword Result = 0x00000001 ~ 0x00001000;
// Perform bitwise XOR with 2 DWORDs
dword Result = Dword1 ^ Dword 2;