In order to enable switching between modules from the CBworkbench, you have to add the following line to the .CBworkbench-File in your home-directory: *moduleUsage: 1. In case there is no CBworkbench file in your home-directory yet, you'll be able to create one via using the Save options menu-entry from the Options menu.
The standard way changing the module-context is to choose the change module Menu entry from the Options menu in the CBworkbench. Alternatively press the Module button from the menu bar. After choosing the change module function from your CBworkbench-window, you should get a listbox containing the System module. Double-clicking a module entry in the listbox sets the current module-context to the selected module and lists all contained nested modules of that certain module.
Figure 5.1: The module-context selection window.
After double-clicking the System module, you should get a new listbox containing the modules System, Employees, Managers (see Figure 5.1). Now double-click the listbox-entry Managers. As a result the module-context of the CBserver is set to the module Managers. As the Managers module has got no nested modules, the module-context selection window now shows the entry nil under the Managers entry.
Alternatively you can specify the module-context using the load model-Operation and placing a {$set module=MODNAME} inline-command in the very first line of a SML-file. MODNAME stands for the name of the module in which you wish to define the content of the SML-file. Please note that only one inline-command is allowed within one SML-file. Specifying module-contexts using inline commands is a facility for automatically loading SML-definitions of large applications which are spread over different modules -- without requiring the user to select the change module-function from the CBworkbench.
Let's set the module-context to Employees and then TELL the following frame:
Employee with
attribute
name : String
end
The object Employee is now only visible in the module Employees. When you set the module-context to Managers (or System) and try to load the Employee object, you should get an error message from the server stating that the object Employee is not visible in that module-context.