| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (12 out of 12)

Filtering Classes of Items

When inspecting classes of items by using every in the command, you can restrict the search to include only those items that meet certain criteria. This is a powerful way of identifying particular classes of items to inspect.

This filter applies when you inspect classes of items by using the every syntax with the `following Inspect commands:

You can provide any number of filters, connected by and and or, and optionally grouped in parentheses for clarity. For example, to see all the pipes that fall within an acceptable diameter range, enter the following:


Note: When combining filters in an Inspect command, it is up to you to insure that the filter expressions are not mutually exclusive.

Filtering Items Based on a Truth-Value Expression

You can filter items based on a condition that you specify as a truth-value expression. Use the such that phrase as the filter. The syntax for the filter expression is:

For example, the following command finds every variable with a current value.

For information about truth-value expressions, see Chapter 20, Expressions.


Note: You cannot use such that to test the value of an attribute; use where instead (see Filtering Items Based on the Value of an Attribute).

Filtering Items that Contain Specific Text

You can filter items based on the existence of a particular piece of text by using containing the as the filter. The item can contain a word, a string, or a symbol.

The format for the filter expression is:

For example, this command finds every statement containing the specified text.

If you use the word or the symbol in the command, the command only finds text that exactly matches the specified word or symbol; it does not find partial strings. For example, the following command only finds statements containing the word inform; it would not find strings that contained the word information, for example.

Filtering Items that Contain Notes

You can find items based on whether or not they contain a value other than OK in the Notes attribute. This command allows you to locate all items with unspecified information. For example:

Filtering Items Based on the Item's Status

Every item has a status that indicates various information about the item:

You can find items based on their status by using the following as the filter:

For example:

Filtering Items Based on the Value of an Attribute

You can filter items based on the value of a numeric or symbolic attribute:

The format for the filter expression is either of these expressions:

Two examples are:

Filtering Items Based on their Category or Focal Class

Every rule has the attributes Categories, Focal-classes, and Focal-objects. You can filter rules based on their category, focal class, or focal object by using the following filter expressions:

Two examples are:

Filtering Items Based on Their Workspace

You can filter objects based on the workspace on which the object is located by using found on the workspace in the command.

Filtering Items Based on Their Module

You can filter items based on their assigned module as follows:

For example:

You can filter items based on a list of modules, by separating the modules names with or, as follows:

If there are more than two modules in the list, separate the module names with a comma, and separate the last two module names with or.

This example shows how you filter items based on any module in a hierarchy, as follows:

Filtering Items that Do Not Meet Specified Criteria

You can use the word not in conjunction with any of the previously discussed filter expressions to restrict the search to those items that do not meet the criteria.

The word not precedes the filter expression.

For example, the following command finds all class definitions whose status is not OK:

The following command finds every variable that does not have a current value:

| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (12 out of 12)

Copyright © 1997 Gensym Corporation, Inc.