Introduced in PAtools 7.2

Libraries are handled in PAconfigurator, identical to all other group types. To create, edit, delete, import and export or update the Libraries node, refer to the PAconfigurator section.

Figure 41. Folder for PAscript Libraries

Creating Libraries

You can create new libraries in PAconfigurator in the PAscript » Libraries node using one of the following methods:

  • From the menu, select File » New » Group » PAscript Library.
  • In the context menu, select New » Group » PAscript Library.

The newly created node is in edit mode so that you can immediately define the name for the new library.

Rules for Naming Libraries

When defining the name of libraries, note the following:

  • The library name is not a standard name. It is freely definable.
  • Like standard names, library names apply to the entire database, not just to one test.
  • Library names must be unique for the entire database. There is no distinction between upper-case and lower-case letters.
  • You can use all characters that are permitted for file names in library names as well.
  • Once a name has been assigned, it may no longer be changed once it has been used.
Note If you want to rename a library that is in use, a message box appears. If you decide to rename the library anyway, all objects that use this library can no longer access its global classes. These objects are then marked as invalid by red font in the PAconfigurator explorer.

Editing Libraries

If you have just created a new library or have just opened it again, the PAscript Editor for implementing of functionality opens.

The same rules apply to the implementation of the library as to the creation of PAscript programs; there is a single input area in the editor per each library.

All functions, variable and constants must be saved in the same library - endlibrary block.

Libraries can in turn use other libraries. This is implemented with one or more using directives, just as when integrating a library into a program. The using directives must stand before the library key.

Note When saving a modified library, the system does not currently check whether functions contained in the library are being used in a PAscript or PAgraph++ program. If you change existing public functions (function name, parameter list or list of return values) or remove them completely, you must first make sure that the old function is not required.

Deleting Libraries

Note In PAtools 7.2 or later, on it is checked whether the library is used in a PAscript or a PAgraph++ program.

If you want to delete a library that is in use, a message box appears. If you decide to delete the library anyway, all objects that use this library can no longer access its content. These objects are then marked by red font in the PAconfigurator explorer.

Export and Import Libraries

You can export and import libraries either as a complete group or the code of a library.

Export/Import as Complete Group

Libraries are exported using PAconfigurator standard functionality Export XML (PAtools) or imported using Import XML (PAtools), as .xml file extensions is suggested.

When importing, you must ensure that the PAscript Libraries node is always set as the target. Otherwise, the import process is terminated with an error message.

If a library already exists with the name of the imported group, a new library is created under a new name.

Export/Import the Code of a Library

The code of a library is exported or imported together with all comments in PAscript Editor using the menu command File » Export to file or File » Import from file as the file extension .pascript is suggested.

To import exported code or exported libraries from PAtools 7.0 or 7.1 into libraries of version 7.2 or higher, PAscript Editor also enables the import of the file extensions .pascriptlib or .pascriptlibx.

After the import, the entire original content of the library is replaced by the imported content. However, the library name is unchanged.