Prev Up Next
Go backward to Comparison operators (EQ,NE,GE,LE,GT,LT)
Go up to If...else...command (single sortword environment)
Go forward to Masking operator (MASKEDBY)

Filtering operators (PASSES,FAILS)


IF <sortword>|(<expression>) PASSES (<lower-limit> , <upper-limit>) ...


where expressions may be used to define <lower-limit> and <upper-limit>. IF...PASSES is true if <sortword> or <expression> falls inside the gate defined by <lower-limit> and <upper-limit> inclusive, eg.
IF GAMA PASSES (100 , HLIMIT)    INC SPEC1(GAMB)
causes spectrum SPEC1 to be incremented if the value of sortword GAMA lies between 100 and the value of HLIMIT (inclusive).

If <upper limit> is less than <lower limit> then the IF test will always give the result FALSE.


IF <sortword>|(<expression>) PASSES <gate-array-name>(<index>) ...


where <index> is an integer expression which gives the array element number used to obtain a gate defined in <gate-array-name>, eg.
EXTRACT GELIST INTO $G1
IF $G1.TAC PASSES TACLIST($G1) {
   ...


IF <sortword>|(<expression>) FAILS (<lower-limit> , <upper-limit>) ...



IF <sortword>|(<expression>) FAILS <gate-array-name>(<index>) ...


Conversely IF...FAILS is true only if <sortword> or <expression> is present in the event and falls outside the limits of the gate,

eg.

IF GAMA FAILS (100 , HLIMIT) {
    DEC SPEC2(GAMB)
    DEC SPEC3(GAMC)
    }
causes spectra SPEC2 and SPEC3 to be decremented if sortword GAMA is outside the range defined by 100 and HLIMIT (inclusive).
support@ns.ph.liv.ac.uk

Prev Up Next