Description
Creates a new PowerBuilder library.
Syntax
INT PBORCA_LibraryCreate ( HPBORCA hORCASession, LPTSTR lpszLibraryName, LPTSTR lpszLibraryComments );
Argument |
Description |
---|---|
hORCASession |
Handle to previously established ORCA session |
lpszLibraryName |
Pointer to a string whose value is the file name of the library to be created |
lpszLibraryComments |
Pointer to a string whose value is a comment documenting the new library |
Return value
INT. Typical return codes are:
Return code |
Description |
---|---|
0 PBORCA_OK |
Operation successful |
-1 PBORCA_INVALIDPARMS |
Invalid parameter list |
-4 PBORCA_BADLIBRARY |
Bad library name |
-7 PBORCA_LIBIOERROR |
Library I/O error |
-8 PBORCA_OBJEXISTS |
Object already exists |
-9 PBORCA_INVALIDNAME |
Library name is not valid |
Usage
You do not need to set the library list or current application before calling this function.
Adding objects
PBORCA_LibraryCreate creates an empty library file on disk. You can add objects to the library from other libraries with functions like PBORCA_LibraryEntryCopy and PBORCA_CheckOutEntry. If you set the library list so that it includes the new library and then set the current application, you can import object source code with PBORCA_CompileEntryImport and PBORCA_CompileEntryImportList.
Examples
This example creates a library called NEWLIB.PBL and provides a descriptive comment:
LPTSTR pszLibraryName; LPTSTR pszLibraryComments; // Specify library name and comment string pszLibraryName = _TEXT("c:\\appeon\\pb2019\\demo\\newlib.pbl"); pszLibraryComments = _TEXT("PBL contains ancestor objects for XYZ app."); // Create the library lpORCA_Info->lReturnCode = PBORCA_LibraryCreate(lpORCA_Info->hORCASession, pszLibraryName, pszLibraryComments);
In these examples, session information is saved in the data structure ORCA_Info, shown in About the examples.
See also