UseLSX statement (LotusScript® Language)

Loads a LotusScript® extensions (lsx) file containing Public definitions needed by the module being compiled.


UseLSX lsxLibraryName



A string literal specifying the lsx file to load, either a name prepended with an asterisk or the full path name of the file. If you specify a name prepended with an asterisk (for example, "*LSXODBC"), the file is determined by searching the registry, initialization file, or preferences file, depending on the client platform. The Windows registry, for example, might contain an entry for HKEY_LOCAL_MACHINE, SOFTWARE, Lotus®, Components, LotusScriptExtensions, 2.0, LSXODBC, whose value is "c:\notes\nlsxodbc.dll."

lsxLibraryName can contain "?", an optional flag that signals the lsx file is not necessary during run time. The question mark is part of the String, * and % flags follow the ? if desired. e.g. "?*NAME_OF_LIBRARY". For example:

const lsxLibraryName = "?NAME_OF_LIBRARY"
UseLSX lsxLibraryName	


LotusScript® registers the Public classes defined in the lsx file for use in the module containing the UseLSX statement. Other modules that use this containing module can also access these Public classes.

Note that Notes® supports the UseLSX statement. The UseLSX statement loads a .LSX file containing Public definitions. These definitions then become available to the current script. Once the .LSX file has been downloaded, its classes are browsable in the Notes® class browser.

The Notes® platform has a registry of LSXes. If the file-specification string in the UseLSX statement begins with an asterisk (*), then Notes® looks in the registry for the name consisting of the rest of the string. The registry entry for that name specifies the file location in the platform file system.

The "_" is reserved for Notes® specific dlls. This is a change put in as of Notes® 4.5.1. If you attempt to load a dll in Notes® 4.51 or greater using LotusScript® and the name of the dll is preceded by an underscore you will receive the error "Error in loading DLL".

A library name prefixed with a '?' is considered to be optional at run time. The library must be present at compile time in order to compile the script, however, if the LSX cannot be loaded at run time, the script will still execute as long as classes defined by the LSX are not referenced or functions/procedures defined by the LSX are not called from the script. If the LSX is not loaded and a line of script references an LSX class or procedure, the following errors would be thrown.

ERR = 230 ERROR = Unknown class instance

ERR = 48 ERROR = Error in loading DLL