The IN function searches for occurrences inside a container. The
IN function is a special case of the CONTAINED_BY function. In its
most common form, the function format is as follows:
IN( <container>, <containee> )
In this format, <container> and <containee> can be any legal query
expression. The IN function returns all occurrences that match the
<containee> expression as long as those occurrences are somewhere
inside the container.
Some examples will help you understand the IN function. The
following picture applies to the examples that follow.
A (module)
+-------------------------+
| |
| B (routine) |
| +-------------------+ |
| | | |
| | C (routine) | |
| | +-------------+ | |
| | | | | |
| | | D (variable)| | |
| | | | | |
| | | | | |
| | +-------------+ | |
| | | |
| +-------------------+ |
| |
| E (variable) |
| |
+-------------------------+
Consider the following queries:
1. FIND IN( A, *)
2. FIND IN( B, D)
3. FIND IN( A, SYMBOL_CLASS=ROUTINE and OCCURRENCE=DECLARATION)
The first query returns B (a containee), C (a containee), D (a
containee) and E (a containee). A is not returned because it is
the container.
The second query returns only D (the containee). C is not returned
because it does not match the <containee> expression. B is not
returned because it is the container.
The third query returns all routine declarations inside A. In this
case, B and C are returned.
The IN function is a convenient way to limit a query to a
particular container.
The full format of the In function is as follows:
IN( [END=<container>],
[BEGIN=<containee>] )
In this format, <container> and <containee> can be any legal query
expression.