FiltLow

(Engine-Level Function)

Description: Sets the values in an array sub-range that fall below a specified lower limit to a new value.
Returns: Nothing
Usage: Script only.
Function Groups: Array
Related to: ArrayOp1 | ArrayOp2 | Filter | FiltHigh
Format: FiltLow(ArrayElem, N, Limit, Value)
Parameters:  
ArrayElem
Required. Any array element giving the starting point in the array for the search. The subscript for the array may be any numeric expression.
If processing a multidimensional array, the usual rules apply to decide which dimension should be used.
N
Required. Any numeric expression giving the number of array elements to use, starting at the element given by the first parameter. If N extends past the upper bound of the lowest array dimension, this computation will "wrap-around" and resume at element 0, until N elements have been processed.
Limit
Required. Any numeric expression giving the lower cutoff value for the array elements. Any array elements in the range that are strictly less than this value are set to the Value parameter.
Value
Required. Any numeric expression giving the new value to set the array elements that fall below the Limit parameter. The function still continues if this parameter is invalid, in which case the new values become invalid.
Comments: The statement is useful for setting array elements below a limit to a minimum value or to invalid.

Example:

Assume that there exists an array whose subscripts start at 0, such that x = { 2, 1, Invalid, 10 }

  If changeArray;
  [
    FiltLow(X[0] { Start of array }, 
            4 { Number of elements to process }, 
            2 { Min value in the array }, 
            Invalid { Default value if under the limit }); 
    ChangeArray = 0; 
  ]

If the variable ChangeArray is set to true, X will be changed to X = [2, Invalid, Invalid, 10 ]