====== Bit-wise operators (BitAnd, BitOr, BitXor, BitNot) ====== ==== Description ==== Perform bit-wise And, Or, and Xor logical functions on two numbers. BitNot yields the logical Not of a number. ==== Syntax ==== BitAnd (expression, expression) BitOr (expression, expression) BitXor (expression, expression) BitNot (expression) ==== Parameters ==== The Bit-wise operators have the following parameter. ^Parameter^Description^ |//expression//|Must yield an integer.| These functions can be used to calculate the binary result from subjecting two integer numbers to And, Or, Xor, and Not evaluation. The result will be an integer. Each number may be up to 32 bits. Hence, 232 - 1, or 4,294,967,295, is the largest number that can be used by these functions. ^Operator^Description^ |BitAnd|Calculates the bit-wise logical And of two integers.| |BitOr|Calculates the bit-wise logical Or of two integers.| |BitXor|Calculates the bit-wise logical exclusive Or of two integers.| |BitNot|Calculates the bit-wise logical Not of the integer yielded by expression.| **Result Tables** ^Bit in expression 1^Bit in expression 2^BitAnd^BitOr^BitXor^ |0|0|0|0|0| |0|1|0|1|1| |1|0|0|1|1| |1|1|1|1|0| ^Bit in expression^BitNot^ |0|1| |1|0| ==== See Also ==== [[psstyle|PSStyle property]], [[colstyle_message|COLSTYLE message]], [[iconv_mx_hex_mo_mb|IConv( expression, "MX")]], [[oconv_mx_hex_mo_mb|OConv( expression, "MX")]], [[rti_style_equates_insert_record|RTI_Style_Equates]] ==== Example ==== subroutine LockColumns(Table, LockCols) * Table is the fully qualified name of an edit table control * LockCols is the number of columns in the edit table control that should be horizontally locked declare function Send_Message declare subroutine Send_Message * style bit for the edit table to horizontally lock a column equ LOCK_STYLE$ to 8192 * get the number of columns in the edit table ColCount = Get_Property(Table, "LIMIT") <1> * get the column styles for the edit table Styles = Send_Message(Table, "COLSTYLE", 0, "") for i = 1 to ColCount if i <= LockCols then * turn on the lock style for the column Styles = bitor(Styles, LOCK_STYLE$) end else * turn off the lock style for the column Styles = bitand(Styles, bitnot(LOCK_STYLE$)) end next i * set the modified column styles Send_Message(Table, "COLSTYLE", 0, Styles) return