Window iterators are a means of explicitly iterating over all of the records stored in a window. It is usually more convenient, and safer, to use the for loop mechanism (see above), but iterators provide extra flexibility.
Each block of code has implicit variables for windows and window iterators. If an input window is named Stream1, there are variables Stream1_stream and Stream1_iterator.
Those variables can be used in conjunction with the following functions.
Syntax: deleteIterator(iterator)
Type: The argument must be an iterator expression. The function returns a null value.
Example: deleteIterator(input_iterator)
Syntax: getIterator(windowName)
Type: The argument must be a window expression. The function returns an iterator.
Example: getIterator(input_window)
Syntax: getNext(iterator)
Type: The first argument must be an iterator expression. The function returns a record, or "null" if there is no more data in the iterator.
Example: getNext(input_iterator)
Syntax: resetIterator(iterator)
Type: The argument must be an iterator expression. The function returns an iterator.
Example: resetIterator(input_iterator)
Syntax: setRange(iterator fieldName... expr...)
Type: The first argument must be an iterator expression; the next arguments must be the names of fields within the record; the final arguments must be expressions. The function returns an iterator.
Example: setRange(input_iterator,Currency,Rate,'EUR',9.888)
Syntax: setSearch( iterator number... expr...)
Type: The first argument must be an iterator expression; the next arguments must be column numbers (starting from 0) in the record; the final arguments must be expressions. The function returns an iterator.
Example: setSearch(input_iterator,0,2,'EUR',9.888)