Partager via


How to: Filter the Class Browser Class List

You can display a specific set of classes by specifying a class type, class name, or a filter in the Class Browser.

To filter the class list

  1. In the Class Browser, open the class library you want.

    For information about opening the Class Browser, see How to: Run the Class Browser.

  2. In the type box, select a class from the list, type the name of a class, or type a single filter or filters separated by commas, which act as logical OR operators.

    Note

    A class needs to match only one filter for inclusion in the class list.

    The classes that match the class, type, or filter you specified appear in the class list. The filters you specify are added to the type list.

The type list keeps a history of the types and filters you selected only for the current instance of the Class Browser. The list is not saved after you close the Class Browser.

Note

Hierarchical mode is selected by default on the Class Browser shortcut menu. When Hierarchical mode is selected, Visual FoxPro evaluates parent classes. If a parent class matches the filter, its child classes are evaluated. If the parent class does not match the filter, its child classes are not evaluated and do not appear in the list, even if the child matches the filter.

You can expand your search for classes to include a specific character string in the name or description.

To search by class name and description text

  1. In the Class Browser, open the class library you want.

  2. In the Class Browser, click the Find button.

  3. In the Look for box of the Find Class dialog box, type a string of text that you want to search for.

  4. Click Find.

Classes that contain the string in its name or description appear in the class list.

Note

When Hierarchical mode is selected, only the matching parent classes and their associated matching subclasses appear in the list.

The following table of filter operators and expressions describes wildcard characters you can combine with the characters in a class name to create a filter in the Class Browser.

Filter contains

Description

+ cTargetName

Name must start with cTargetName.

% cTargetName %

Name contains cTargetName.

For example, to view all classes containing the string "mover," type %MOVER%.

- cTarget

Name does NOT contain cTarget.

Takes precedence over other search filters.

~ cTarget

Name contains something similar to cTarget.

cTarget *

An asterisk (*) replaces an unlimited number of characters.

Name contains anything following cTarget.

For example, to view all classes beginning with "VCR," type VCR*.

" cTarget "

Name is cTarget.

If cTarget is not a base class, report results of class name search.

cTarget

If cTarget is a base class, report all members of the base class regardless of the name.

[?...]cTarget[?...]

Name contains cTarget plus the specified unknown characters in the specified relative positions.

The question mark (?) replaces a single character. You can use question marks in any position and in any quantity.

For example, to view all classes starting with MsgBox and some number, such as MsgBox1, type MsgBox?.

The following table describes examples that illustrate combinations of filter expressions separated by spaces, which represent the OR operator.

If you want this

Use an expression like this

The target is a string that must start with "test" but is NOT a "form" class.

-%form% +test*

The target is any string that does NOT contain "debug" and starts with "c" OR contains "test".

c* %test% -%debug%

The target is any string that does NOT start with "debug" and is similar to "test" OR is the string "myform"

~test -debug* "myForm"

See Also

Tasks

How to: View Class Hierarchies

How to: View Class Definition Code

Reference

Class Browser Window

Other Resources

Operating the Class Browser

Managing Classes and Class Libraries