export
Makes a variable or a function in a PSL library available to other PSL libraries and functions.
Syntax
export function function ;
Parameters
Parameter | Definition |
---|---|
variable | name of a PSL variable that is available for export to another |
function | name of a PSL function that is available for export to another |
Description
The export statement makes a variable or function in a PSL library available for export to another PSL library or program using the requires statement. Each export statement can specify a single variable or function.
Global variables and functions need not be declared before the export statement. The export statement does not require that a variable be explicitly defined within a library, but it does require that it appear in a PSL statement to create an implicit definition.
Placement of the export Statement
The export function statement can appear before or after the actual function definition. The export variable statement can appear before or after the first appearance of a global variable.
An export statement can appear inside a function definition without any special significance. BMC Software discourages placing export statements inside function definitions.
Errors Involving the export Statement
The export statement can generate compiler errors in the following instances:
- variable or function is not defined or used in the library
- variable or function is a PSL built-in function
- variable is a local variable of a user-defined function in the library
- variable or function is duplicated in another export statement
- variable or function has been imported using the requires statement
Where to from here