Click or drag to resize

IMcOMGlobalMcOpNOT Method

Logical unary operator to negate the sense of a selector array

Namespace:  MediaCy.IQL.ObjectManager
Assembly:  MediaCy.IQL.ObjectManager (in MediaCy.IQL.ObjectManager.dll) Version: 10.0.6912.0
Syntax
VB
Function McOpNOT ( 
	Operand As Object
) As McObject

Parameters

Operand
Type: SystemObject
May be a scalar or array of any numeric type. It may also be a McObject instance of a numeric type. If the type does not resolve to mcobjTypeINTEGER (i.e. it must be an McObject of this type or a "long" VARIANT array), then each value is first converted into its corresponding index value; in this process all non-negative values are converted to index while all negative values are converted to -(index+1).

Return Value

Type: McObject
A McObject instance holding a selector inverting the sense of the varOperand selector. The returned result will be of type mcobjTypeINTEGER. And it will be the same shape as varOperand.
Remarks
This is a logical operator that changes the "true/false" sense of a selector. Use the McOpBitwiseNot (complement bits) or McOpNeg (negate values) for arthmetic unary operations. A "selector" is an integral array that has positive index values representing selected, or "true", elements and negative, -(index+1), values representing unselected, or "false", elements. Selectors can be passed in as arguments to the the McObject.SelectedValues property to extract a sub-array containing only selected elements from an array or matrix.
Remarks
This unary operator, changes the true/false sense of a "selector" by changing its negative by applying the operation of value=(-value+1) to each of its elements.
Examples
VB
Dim mcoLeft As McObject
Set mcoLeft = McObjectTemp(Array(1, 2, 3, 4, 5, 6))
varRight = Array(0, 2, 8)
Set varSel = McOpLT(mcoLeft, varRight)  ' Set keeps it an McObject
' Show Operation Selector Result = -1 -2 2 -4 -5 5
Debug.Print "Operation Selector Result = " + McToText(varSel)
' Show SelectedValues of varLeft = 3 6
Debug.Print "Result selected values = " + McToText(mcoLeft.SelectedValues(varSel))
Set varNotSel = McOpNot(varSel)   ' Invert the sense of the selector
' Show Not Operation Selector Result = 0 1 -3 3 4 -6
Debug.Print "Not Operation Selector Result = " + McToText(varNotSel)
' Show SelectedValues of varLeft = 1 2 4 5
Debug.Print "Result Not selected values = " + McToText(mcoLeft.SelectedValues(varNotSel))
See Also