Libraries of sub-programs and UDFBs

The workbench enables you to create pure "libraries" of sub-programs, UDFBs and data structures to be referenced in projects. The link with libraries is automatically performed each time the project is open or re-built. This ensures you that your project always use the latest version of library objects, but it imposes that the library forlder is found at build time.

Note: Alternatively, you can use other methods for sharing programs and sub-programs.

What is a library ?

A "library" is similar to a project, but has a special "mark" so that it can be used as a library. All sub-programs, UDFBs and data structures of a library can be used in projects referring to it. Additionnaly, the library can be open as a normal project, and may contain other material (main programs, global variables...) in order for the library designer to test and validate locally the shared objects of the library.

Creating a library

To create a library, use the "File / New Project" command, and select the "Library" choice in the upper side list of the project creation wizard. The Workbench uses different color settings when editing a library. You can also use the "File / Save Project As..." menu command to save an existing project as a library or the opposite.

Linking a project to libraries

In order to use library items in a project, you must link it to the library. For that run the "Project / Libraries" menu command of the Workbench when editing the project. A box is open and shows the list of already linked libraries. Press the "Add" button to browse the disk for a library folder to be used in the project. Press the "Remove" button to unlink the project from the library selected in the list. Libraries are checked and scanned when you close the box.

A project can be linked to several libraries.

Library items (sub-programs and UDFBs) are not visible in the Workspace area, but can be selected from the bottom-right list area in the Workbench.

Any sub-program or UDFB of a linked library can be used in a program as any other block. The definition of the library blocks (their inputs and outputs) is refreshed automatically:

- when the project is open
- before the project is build
- when you close the library selection box (even with no change)

If the project refers to a library that actually does not exist, an error message is displayed. Compiling errors will happen in that case if you use in your programs items of the missing library.


- A library can be linked to another library. But in that case, when used in a project, the project must be linked to both of them. Below is an example:

Project1 "Project1" must be linked to "LIB1" and LIB2"
  uses LIB1 "LIB1" must be linked to "LIB2"
         uses LIB2  

- You can never open the contents (source code) of a library item from a project. When debugging, you cannot step into a UDFB or sub-program from a library. Library items are not scanned during a "Find in files" research.