Using Script Libraries
About this task
Script libraries can contain LotusScript, Java, or JavaScript. A script library allows you to store classes, functions, and variables for common use within an application. A script library is either a Client Library or a Server Library.
The scope of a script library is the current application. All scripts in a database can avail themselves of the LotusScript, JavaScript, or Java in a library in that database. However, the library is lost to scripts outside the database. For example, if a button in a document uses a script library and you mail the document to or paste it into another database that does not have the same script library, the script fails. If a script attempts to use a library not in the current database, the error message, "Error loading USE or USELSX module" displays.
To create a script library from the Applications Navigator
Procedure
- In the Applications Navigator, expand an application name.
- Double-click Code > Script Libraries.
- Click one of the following buttons depending on the type of library you wish to create: New LotusScript Library, New JavaScript Library, or New Server JavaScript Library.
- Do the following in the New LotusScript Library, New JavaScript
Library, or New Server JavaScript Library dialog box:
- Type a name for the library. The name must be unique and must conform to the naming rules for the operating system.
- Select the desired application from the Application drop-down list.
- Click OK.
To create a script library from the menu
Procedure
- Choose File - New - <type> Script Library.
Choose one of the following types:
- LotusScript Library
- Javascript Library
- Java Library
The Programmer's pane displays the empty script in the Work pane.
- Do the following in the New LotusScript Library, New JavaScript
Library, or New Server JavaScript Library dialog box:
- Type a name for the library. The name must be unique and must conform to the naming rules for the operating system.
- Select the desired application from the Application drop-down list.
- Click OK.
Results
See the following topics for instructions on incorporating a library:
To access an existing script library
Procedure
- From the Applications Navigator, expand Code-Script
Libraries.
A list of script libraries displays in the design element list.
- Select the script library you want to view.
The script library appears in the Programmer's pane.