Language Guide
CHAPTER 5
Objects and References
142 Using the Filter Reference Form
A Filter reference includes one or more tests. Each test is a Boolean expression
that compares a property or element of each object being tested, or the objects
themselves, with another object or value. Table 5-2 shows some Filter references,
the Boolean expressions they contain, and what is being tested in each reference.
Note
A test can be any Boolean expression (such as words
where 1 < 2), but only those that actually test objects
or their contents are useful for filtering objects. ◆
To include more than one test in a filter, link the tests with Boolean operators,
as in
words whose length > 10 and tenth character = "M"
The Boolean operator And indicates that each word must pass both tests to be
included in the smaller container. Another example is
words where it contains "M" or it contains "G"
The Boolean operator Or indicates that the words can pass either test to be
included in the smaller container.
Table 5-2 Boolean expressions and tests in Filter references
Filter reference Boolean expression
What is
being tested
words whose length > 10 length > 10
The length
property of
each word
words whose first character = "M" first character = "M"
The first
character of
each word
words where it contains "el" it contains "el"
The words
themselves