Naming the Top-Level Module
The first step in creating a module is to name the top-level module. This is true whether you are creating modules in an empty KB, or in a KB that already contains items.
To name the top-level module interactively:
Main Menu > System Tables > Module Information
Top-level-module attribute:
![]() |
You can enter any unreserved symbol as the name of the top-level module.
To name the top-level module programmatically:
Execute the following action:
conclude that the top-level-module of module-information
= the symbol module-name
If you have named a top-level module in the current KB, each time you create a new top-level workspace, G2 automatically assigns the workspace to the top-level module.
Naming Conventions for Modules
When naming the top level or other modules, we recommend following the standard naming conventions described in Syntax for KB Filenames.
Associating Items With a Module
After creating a module, you typically associate the module with a set of items in the current KB. You do this by associating the module with a top-level KB workspace. G2 associates the module with this workspace and with all items below the workspace in the workspace hierarchy.
To associate a module with a top-level workspace interactively:
Module-assignment attribute.
To associate a module with a top-level workspace programmatically:
Execute this action:
conclude that the module-assignment of kb-workspace
is module-name
Module-assignment attribute to the name of the top-level module.
You can save modules interactively or programmatically.
To save a module in a file interactively:
Main Menu > Save KB.
test-module module:
![]() |
To save a module programmatically:
Use the g2-save-module system procedure, as described in the G2 System Procedures Reference Manual.