Loading...
 

CX_BIT_PATTERN

CX_BIT_PATTERN

Class hierarchy
Description:

This class maps a bit pattern in the system. The bit pattern is a combination of bits, often used to indicate the possible unique combinations of a certain number of bits. A pattern of 32 bits exactly 232 combinations is allowed.

197959

For example, a CX_BIT_PATTERN can also be used in an enumeration widget by selecting individual bits of the CX_BIT_PATTERN using an access expression:

slotName.pattern[0]
Code example:

Var(typePattern)
CreateTransObject(CX_BIT_PATTERN) -> typePattern
0 GetValue(, ShowFolder) typePattern Call(SetBit)
1 GetValue(, ShowItem) typePattern Call(SetBit)
2 GetValue(, ShowSubItem) typePattern Call(SetBit)
........................
7 typePattern Integer > |
.........................
// Type suitable?
tmpTodo Cardinality(subTransactions) // is folder
typePattern Copy(GetBit(0)) &
tmpTodo Cardinality(subTransactions) ! tmpTodo Get(transaction) if FALSE else TRUE & // is item
typePattern Copy(GetBit(1)) &
tmpTodo Get(transaction) if TRUE else FALSE // is subitem
typePattern Copy(GetBit(2)) &
| | ifnot return

Further notes on semantics:

Unlike CX_INTEGER, a CX_BIT_PATTERN object for if and ifnot always evaluates to TRUE (regardless of the value).

CX_BIT_PATTERN supports the following operators:

& = Bitwise AND | = Bitwise OR ^ = Bitwise XOR

These operators also support the linking of INTEGER or CX_INTEGER with a CX_BIT_PATTERN. For this, the numerical value is automatically converted into a bit pattern before the operation. The result of these operators is always a new CX_BIT_PATTERN object.

List of methods (MDI)
Function MA* Parameters Return Brief description
All INTEGER | CX_INTEGER | CX_BIT_PATTERN CX_BOOLEAN If all bits in the integer on the stack are also set in the Bitpattern, the result is TRUE, otherwise FALSE
Any INTEGER | CX_INTEGER | CX_BIT_PATTERN CX_BOOLEAN If at least one bit in the integer on the stack is also set in the Bitpattern, the result is TRUE, otherwise FALSE
And
225959
INTEGER | CX_INTEGER | CX_BIT_PATTERNCX_BIT_PATTERNPerforms a bitwise ampersand operation.
Bit INTEGER CX_BOOLEAN Query bit
GetBit INTEGERINTEGER Query bit
Invert
225959
CX_BIT_PATTERNInverts each bit in the bit pattern.
LeftShift
225959
INTEGERCX_BIT_PATTERNShifts the bit pattern n bits to the left.
Not
225959
CX_BIT_PATTERNPerforms logical negation on the bit pattern.
Or
225959
INTEGER | CX_INTEGER | CX_BIT_PATTERNCX_BIT_PATTERNPerforms a bitwise OR operation.
RightShift
225959
INTEGERCX_BIT_PATTERNShifts the bit pattern n bits to the right.
SetBit INTEGER, INTEGER Set bit
SetEnumTbl STRING Set enumeration table
Xor
225959
INTEGER | CX_INTEGER | CX_BIT_PATTERNCX_BIT_PATTERNPerforms a bitwise xor operation.
string INTEGER CX_STRING Returns the string representation of the object.

* MA = Member Access Function

Data directory (DDI)
Data field Type Reference class I* Brief description
pattern INTEGER Bit pattern

* I = Indexable data field

Use in AppsWH
Module Brief description