Skip to content

Use VoltScript Library Modules

Info

For pulling external VoltScript Library Modules via dependency management, see the relevant repository or, for HCL-developed library modules, see the references.

Note

Domino developers will be familiar with the Use statement for incorporating external script library modules. However, in an NSF all script libraries have to be placed in the same location.

VoltScript files can include VoltScript code in external .vss files. This is done by referencing the filename, without the .vss suffix, in a Use statement at the start of the script. The file can be referenced with a relative or absolute path.

Note

Currently, relative paths are relative to the file being run. If a VoltScript File A contains a Use statement to File B, which contains a Use statement to File C, the relative path for File C is resolved relative to File A, not File B.

Warning

Although valid for one-off runs, absolute paths should be avoided, because it makes code more difficult to transfer to other environments.

Correct Syntax

Assume the following directory structure:

/tmp/projecta
    entry.vss
    libA.vss
    libB.vss
    libC.vss

The following would be valid Use statements and positioning in entry.vss:

Use "libA"  'Looks for libA.vss in the same directory
Use "../projecta/libB"  'Navigates to parent directory (tmp) of the current directory (projecta), then looks for libB.vss in projecta directory
Use "/tmp/projecta/libC"  'Looks for /tmp/projecta/libC.vss

Sub Initialize

End Sub

Note

  • The directory separator "/" should be used for cross-platform compatibility. It's standard for *nix platforms but also understood by modern Windows platforms.
  • See Structuring Your Project for best practices.

Dependency management

It's recommended to include VoltScript Extensions via dependency management. This will automatically download and extract the files, and create the seti.ini. For details of what to add to your atlas.json, see references on VoltScript Library Modules.

Troubleshooting

If the VoltScript Dependency Manager fails, review the information printed to the console. An atlas-settings.json will be required for dependencies pulled from GitHub or from a web server that requires authentication. The dependencies will be downloaded to the .vss directory in the user's home before being copied to the project. If using a dev container, this will be the user's home in the container.