AddToLibraryList

Description

Adds new files to the library search path of an application or component at runtime.

Syntax

AddToLibraryList ( filelist )

Argument

Description

filelist

A comma-separated list of file names. Specify the full file name with its extension. If you do not specify a path, PowerBuilder uses the system’s search path to find the file.

Returns

Integer. Returns 1 if it succeeds. If an error occurs, it returns:

Usage

When an application needs to load an object, PowerBuilder searches for the object first in the executable file and then in the dynamic libraries specified for the application. For a deployed component, PowerBuilder searches the PBD files in the component’s library list. You can specify additional library files with AddToLibraryList.

Calling AddToLibraryList appends a new list of files, in the order in which they are specified in filelist, to the list of library files specified in the target. If filelist contains a file name that is already in the library list, that file name is not added to the library list. If filelist contains more than one occurrence of a given file name, the first occurrence is added to the library list.

To avoid problems that can occur when components share resources, you should use AddToLibraryList instead of SetLibraryList to add additional PBD files to the search list of a component deployed to EAServer.

PowerBuilder cannot check whether the libraries you specify are appropriate for the application. It is up to you to make sure the libraries contain the objects that the application or component needs.

This function has no effect in the PowerBuilder development environment.

Examples

Example 1

This example adds different PBDs to the library search path depending on whether product or customer processing is to be performed:

CHOOSE CASE processkind
   CASE "product"
      AddToLibraryList(prod.pbd)
   CASE "customer"
      AddToLibraryList(cust.pbd)
END CHOOSE 

See also