|
Performs an sequential search in "array", starting at "offset". Comparison is made by evaluating "filter_expr" for each element. This allows you to specify the comparison type.
element provides the variable name for the individual elements in the array when evaluating the filter expression. It is a "var" parameter which is made a reference to each element in the array before evaluating the expression. Example 1:Given l.data as a structured array l.data[n]:id l.data[n]:name l.data[n]:amount <MvIF EXPR = "{ miva_array_search( l.data, 1, l.element, 'l.element:id EQ 99' ) }"> <MvEVAL EXPR="{ l.element:id}">, <MvEVAL EXPR="{ l.element:name}">, <MvEVAL EXPR="{ l.element:amount}"><br> <MvELSE> Record not found. </MvIF> filter_expr is an expression similar to the EXPR attribute to MvFILTER. The expression is executed in the same state as the caller of miva_array_search(). All local variables within that context are available and function calls are permitted. Example 2:<MvASSIGN NAME = "l.array" INDEX = 1 VALUE = "wombat"> <MvASSIGN NAME = "l.array" INDEX = 2 VALUE = "badger"> <MvASSIGN NAME = "l.array" INDEX = 3 VALUE = "beaver"> <MvASSIGN NAME = "l.badger_pos" VALUE = "{ miva_array_search( l.array, 1, l.element, 'toupper( l.element ) EQ \'BADGER\'' ) }"> |