| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 9)

Obtaining Information About Modules

You can use the Inspect facility to show the module hierarchy of the current KB. You can perform operations on modules from the module hierarchy display. You can also display all Module Information system tables in the current KB.

At the item level, you can display the module assignment of a workspace or the items that reside upon it. You can also programmatically obtain the containing-module of an item.

Displaying the Module Hierarchy

You can display the module hierarchy of the current KB or of a particular module in the KB.

The module hierarchy shown in the Inspect workspace represents only the network of references to module names found in the Directly-required-modules attributes of the Module Information system tables.


Note: The module hierarchy does not indicate whether top-level workspaces are assigned to a particular module.

To display the module hierarchy of the current KB:

  1. Choose:

  2. Enter this Inspect command:

    Entering this command causes G2 to display an Inspect workspace containing a diagram of the complete module hierarchy, such as:


    In this module hierarchy, module-a is the top-level module.

To display the module hierarchy for a particular module:

  1. Choose:

  2. Enter an Inspect command like this:

    Entering this command causes G2 to display an Inspect workspace containing a partial module hierarchy, such as:


To perform operations on a module in the hierarchy:

  1. Click on the short representation of the module in the hierarchy


  2. Select table to display the Module Information system table for the module.

  3. Select describe to describe the module by using the Describe facility.

  4. Select hide to hide the short representation of the module in the hierarchy.

If a module hierarchy contains modules that are directly required by more than one module, G2 displays the subhierarchy for the module only once. In the other locations in the hierarchy that require the module, G2 displays only the directly required module, not its submodules.

For example, if you show the workspace hierarchy for G2 GUIDE, you see that the UIL module is directly required by five other modules. However, G2 displays UIL's directly required modules only once, to the far left.


Displaying Module Information System Tables

You can use Inspect to display short representations of the Module Information system tables of all loaded modules.

To display the Module Information system tables for all modules:

G2 displays a workspace such as the following:


In this Inspect workspace, the Module Information whose short representation does not identify a module is associated with the top-level module.

Displaying the Module Assignment of Items

If an item resides upon a workspace that is assigned to a module, you can display that module assignment.

To display the module assignment of an item:

  1. Click any item to display its menu.

  2. Select describe to describe the item, using the Describe facility. If the item resides upon a workspace that is assigned to a module, its description includes a line such as:

  3. Select Delete Workspace to close the item description.

Choosing the workspace Display menu option reveals its module assignment, which is also available in the Module-assignment attribute of the workspace attribute table.

Obtaining the Containing Module for Items Programmatically

Most items include a hidden attribute that defines the modules in which they are contained. You can obtain this information programmatically.

To obtain the containing module of an item programmatically:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 9)

Copyright © 1997 Gensym Corporation, Inc.