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.

ParameterDescription
expressionMust 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.

OperatorDescription
BitAndCalculates the bit-wise logical And of two integers.
BitOrCalculates the bit-wise logical Or of two integers.
BitXorCalculates the bit-wise logical exclusive Or of two integers.
BitNotCalculates the bit-wise logical Not of the integer yielded by expression.

Result Tables

Bit in expression 1Bit in expression 2BitAndBitOrBitXor
00000
01011
10011
11110
Bit in expressionBitNot
01
10

See Also

PSStyle propertyCOLSTYLE messageIConv( expression, "MX")OConv( expression, "MX"), Appendix_D:$INSERT Records_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<i> = bitor(Styles<i>, LOCK_STYLE$)
  end else
    * turn off the lock style for the column
    Styles<i> = bitand(Styles<i>, bitnot(LOCK_STYLE$))
  end
next i
 
* set the modified column styles
Send_Message(Table, "COLSTYLE", 0, Styles)
return
  • No labels