Library Structure
- Updated2025-10-31
- 2 minute(s) read
Functions, constants and variables are defined in libraries. Functions and constants are defined the same way local variables are defined in the PAscript programs.
The structure of each PAscript library is described schematically as follows:
library
// Declaration of variables / constants
...
// Declaration of functions
...
endlibrary
The anchor of a PAscript library is formed by the two keywords library and endlibrary.
The code between these two keywords describes the content of the library.
Variables and Constants
Variable and constants are defined the same way local variables are defined in the PAscript programs.
type var_1 [ = initialization], var_2 [ = initialization] ... type variable_1, variable_2, ... variable_n
Where all data types that are also allowed for local variables can be used as data type.
You can also assign the keyword private to variables. Variables labeled this way can only be used within the library. You cannot access them from outside the library.
Example

Access Private Variables and Constants of a Library
Use this followed by the colon operator : to access a private variable or constant within a library function.
type variable = this :privateName
Example

Functions
There is a distinction in the libraries between public and private functions. The main difference between these two types of functions, in addition to the keyword private, is visibility of the functions outside the library. Functions that are defined with the keyword private are only visible and can only be used within the library. All other functions are visible everywhere if the library has been linked in.
The definition of library functions is based on the definition of user-defined programs in PAscript programs.
Example
