OpenLibrary()

Syntax

Result.l = OpenLibrary(#Library, Filename$)
Description
Opens a shared library so that you can access to the functions inside it. If you open a library with the same identifying number as another library which was already open then the previously opened library is automatically closed.

Parameters

#Library - The identifying number for this library. If #PB_Any is used as '#Library' parameter, the new library identifier will be returned as 'Result'. This number should be used in all the other commands whenever you want to identify which library you want to work with.

Filename$ - A string containing the filename of the shared library to open. Typically, if you do not supply a path as part of the filename then the library will be searched for in your application directory, and if it is not there the system library directory will be searched.

Return value

Result - A value showing whether the library could be opened or not. A value of zero means the library could not be opened (file not found or corrupt). Any non-zero value means the library was opened successfully.

Advanced users only:
The value that this command returns is the OS handle or pointer to the library after it has been loaded. You can therefore use the opened library directly with API function calls.

Supported OS

All

<- NextLibraryFunction() - Library Index