Language Guide

CHAPTER 5
Objects and References
Using the Filter Reference Form 141
For example, compare this reference without a filter
every word of paragraph 5
to the same reference with a filter:
every word of paragraph 5 where character 1 = "M"
The first reference specifies all the words in the fifth paragraph. The second
reference, which includes the filter where character 1 = "M", specifies all
the words in the same container whose first character is “M”. Words that do
not pass this test are filtered out.
In effect, a filter reduces the number of objects in the container. Instead of
specifying every word of the fifth paragraph, the reference
every word of paragraph 5 whose first character = "M"
specifies every word of a smaller container, the words of the fifth paragraph
whose first characters are “M”. Similarly,
words 1 thru 5 of paragraph 5 whose first character = "M"
specifies the first five words of the same smaller container.
To determine the objects in the smaller container, the application applies the
filter to all of the objects of the specified class in the specified container—in this
case, the words in the fifth paragraph. The application uses the filter to test
each object in turn, starting with the first.
Within a filter, the predefined variable it refers to the object currently being
tested. For example, in the reference
second paragraph of document "Product Intro"
where it contains "dynamo"
the word it refers to each paragraph in the document Product Intro. The
filter, contains "dynamo", is applied to each paragraph in the document,
resulting in a smaller container whose paragraphs all contain the string
"dynamo". The reference specifies the second paragraph of that smaller
container.