Using Import Modules

How to:

Reference:

An import module is a non-executable procedure that contains Maintain language code. You do not execute an import module as part of your project. Instead, you use it as a library of functions or classes. Using the MODULE IMPORT command, you can bring an import module into any procedure and use its functions and classes. An import module cannot be used for data source access.

If you edit an import module, you will notice that, just as with a procedure, it starts with the keyword MAINTAIN and ends with the keyword END. However, it does not contain a Top function.

You can use the following in an import module:

You cannot use the following in an import module:

Note: When you move an import module into a procedure, the variables, functions, and classes in an import module become part of the name space of the procedure. For example, if you have a variable named COUNT in an import module and import it into a procedure, that procedure cannot define its own variable named COUNT.


Top of page

x
Procedure: How to Use an Import Module in a Procedure
  1. Right-click the procedure.
  2. In the shortcut menu, click Import modules.

    The Use these Data Sources in Procedure dialog box opens.

  3. Select the import modules you want to use in the Available import modules list and click the right arrow button right arrow button.
  4. To remove import modules you no longer need, select them in the Modules to import list and click the left arrow button left arrow button.
  5. Use the Move down and Move up buttons to change the order of the import modules (the order matters only if import modules have identically named functions).
  6. Click OK.

WebFOCUS Maintain updates the source text of the importing procedure. If this is the first time you specify an import module for the procedure, WebFOCUS Maintain creates an Import Modules folder under the procedure and lists in it the import modules you specified.

Tip: You can also drag an import module to the procedure in which you want to use it.


Top of page

x
Reference: Import These Modules Into Procedure Dialog Box

Specify the import modules to use in your procedure with the Import these Modules into Procedure dialog box, shown in the following image.

Import These Modules Into Procedure Dialog box

This dialog box includes the following options:

Available import modules

Contains a list of the import modules that are part of your project.

right arrow button

Copies a selected import module into the list of modules to import.

left arrow button

Removes a selected import module from the list of modules to import.

Modules to import

Contains a list of the import modules this procedure uses.

Move Up button

Moves a selected import module up in the list of import modules.

Move Down button

Moves a selected import module down in the list of import modules.


WebFOCUS