Not (SelectionCriterion function)

From m204wiki
Revision as of 17:59, 10 December 2010 by 198.242.244.47 (talk) (Created page with "<span style="font-size:120%; color:black"><b>Create selection expression that is a logical negation</b></span> NOT constructor [[Category:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create selection expression that is a logical negation

NOT is a member of the SelectionCriterion class.

This shared method creates a new SelectionCriterion object that is a logical negation of its SelectionCriterion parameter. A NOT criterion returns true for a collection item if NOT's component SelectionCriterion expression is false for the item; otherwise it returns true.

The collection searching method (?? refid=srchcol.) that makes use of this selection criterion specifies:

  • Whether to return the first item or item number or all items that satisfy the selection criterion.
  • Where in the collection to begin searching.

Syntax

  %selc = [%(selectionCriterion for itemtype):]  -
           NOT(criterion)

Syntax terms

%selc
A SelectionCriterion object variable to contain the new object instance.
%(selectionCriterion for itemtype)
This optional specification of the class and collection item type in parentheses indicates that the method is shared and does not operate on a specific instance.
criterion
A SelectionCriterion object.

Usage Notes

The NOT constructor is never necessary, and anything you can do with the NOT can be done (probably more clearly) otherwise. For example, the following two criteria are identical:

    %sel = not(gt(this(90))

    %sel = le(this(90))

And the following two criteria are identical:

    %sel = not(or(lt(this,70), ge(this,95)))

    %sel = and(ge(this,70), lt(this,95))

And these criteria are identical:

    %sel = not(true)

    %sel = false

Internally, NOTs are always converted to the inverse of the parameter criterion.