Skip to content

Library Maintenance

The Library Maintenance dialog is used to add and remove libraries from a workspace. Libraries provide a mechanism for adding a shared library of classes and functions to a workspace.

When a library is added to a workspace, the following occurs:

  • The library’s source paths (AppSrc) will be added to the workspace’s source paths, making all library source files available to the workspace. Most often, the library source files will contain classes.
  • If a library itself contains additional libraries, all of those library paths will be added to the workspace’s source paths.
  • All classes in the library’s class list will be added to the workspace’s class list.
  • Any time the library’s class list changes, the workspace’s library will be updated with the change.
  • Libraries are a very powerful feature of the Studio. See Libraries for more on how this can be used.

The Library Maintenance dialog contains a list that shows all libraries that are part of the workspace. Each library is identified by the library’s .sws configuration file. Note that a library is itself a workspace and is identified the same way any library is identified. Libraries are added and removed from this list by selecting the appropriate button.

Add Library

This button is used to add a library to a workspace. When selected, an open file dialog will be presented. You select a library in the same manner you would select a workspace - search for and select the desired .SWS configuration file.

When the configuration file is selected, the Studio will determine if this library can be identified using a relative path. If it can, you will be asked if you wish to add the library to your workspace using this relative path. In almost all cases, this is recommended. Using relative paths makes it much easier to maintain workspaces and their libraries on multiple computers. As long as the relative paths between workspaces (i.e., the main workspace and the library workspaces) are maintained on all computers, they can be moved to any drive and location you desire.

DataFlex Reports Integration Library

Special support is available for locating and adding the DataFlex Reports Integration Library to your workspace. When you click the special link button, the Studio will search for the DataFlex Reports Integration Library in the usual/default DataFlex Reports Library installation directories.

If the library is detected, an open file dialog will be presented pointing to this location. Select the DataFlex Reports Integration library by selecting the desired .SWS configuration file.

If there are multiple versions of DataFlex Reports installed, the open dialog will point to the nearest directory that is common to each version of the DataFlex Reports Integration library.

Initialize Library Application

For each library that is added to the workspace, the Studio will search for and run a special application that can be used to 'initialize' the library. This application can be designed to perform any action, but normally you would use it to copy special files into the workspace from some location within the library's directories.

The Initialize Library application does not need to be registered in any way. It must be named InitializeLibrary.exe and should reside in the library's Programs folder (see Workspaces and Libraries).

The Initialize Library application is passed two parameters:

  1. The current workspace's fully qualified .sws filename
  2. The library workspace's fully qualified .sws filename

Thus, the format of the application's command line is:

InitializeLibrary.exe "<current_workspace.sws>" "<library_workspace.sws>"

Example:

InitializeLibrary.exe "c:\Projects\Orders\Orders.sws" "c:\Projects\Libraries\Lib1\Lib1.sws"

If the library does not contain an Initialize Library application, then this step is ignored. The Initialize Library application is only fired when you add a new library. No corresponding event is fired when a library is removed.

Remove Library

This button removes a library from a workspace. Select the library you wish to remove and press this button. You will be asked to confirm your action.

Removing a library from a workspace will remove all of the classes in the class list that were defined in this library.

Note that removing a library does not delete or in any way change the actual library. It simply removes it from your current workspace.

OK

This option commits any changes and closes the dialog.

Of Special Note

If you added any new libraries, the workspace’s Class Palette will be updated. Any class defined in the library’s Class Palette will be added to the workspace’s Class Palette.

If you removed any libraries, any of the library classes that were added to the workspace’s Class Palette will be removed.

The workspace’s make-paths will be adjusted if libraries are added or removed.

There is no "Uninitialize Library" application support when a library is removed from a workspace.

See Also