ORCA and the Library painter

A PowerBuilder library (PBL) is a binary file. It stores objects you define in the PowerBuilder painters in two forms: source and compiled. The source for an object is text. The compiled form is binary and is not readable by humans.

The Library painter lets the PowerBuilder developer view and maintain the contents of a PBL. The painter lists the objects in a PBL with their properties, such as modification date and comments.

In the Library painter, the PowerBuilder developer can delete, move, compile, export, and import objects, and can use source control systems and create PowerBuilder dynamic libraries and DLLs.

From the Library painter, you can open objects in their own painters and view and modify the objects graphically.

Objects in a PowerBuilder library

When you open an object in a painter, PowerBuilder interprets the library entries and displays the object in a graphical format. The painter does not display the source code. If you change the object graphically and save it again in the PBL, PowerBuilder rewrites the source code to incorporate the changes and recompiles the object.

Object source code

The Library painter lets you export source code, study and even modify it in any text editor, and import it back into the library. PowerBuilder compiles the imported object to check that the source code is valid. It will not import objects that fail to compile.

Source code exported to a file has two header lines before the source code:

$PBExportHeader$w_about.srw
$PBExportComments$Tell us about the application level

ORCA functions ignore these header lines and use the lpszEntryName and lpszComments arguments passed to the function.

You can view the exported source code in the PowerBuilder file editor:

Learning source code syntax

The syntax for object source code is not documented. The only way to learn what belongs in source code is by exporting objects and studying their source.

ORCA and source code

ORCA has an export function so it can examine and modify existing objects. With PowerBuilder 10 and higher, a developer can configure the ORCA session to export source either to a memory buffer or to a file. The developer can also specify which of the four source encoding formats to use, whether or not to export the two export header lines, and whether or not to include the binary component of an object.

PowerBuilder commands and ORCA functions

Most ORCA functions have a counterpart in the Library painter, the Application painter, the Project painter, or the commands that start and stop a PowerBuilder session.

The next section identifies the ORCA functions, their purpose, and what they correspond to in the PowerBuilder development environment.