The library is saved in different formats in the workspace and solution:
-
In a workspace, the library is saved as a file with file extension .pbl.
The source code and Pcode for multiple objects are stored in the same PBL file.
When a workspace is converted to a solution, the .pbl file is converted into a PBL folder, for example, the a.pbl file is converted to the "a.pbl" folder.
-
In a solution, the library is saved as a folder (the folder name is appended with .pbl at the end).
Each PBL folder contains source code files (such as .sr* files) for multiple objects.
The source code for each object is stored as a separate file. Each PowerBuilder object (such as window, user object, datawindow, etc.) is split into individual source code files, which are stored in text format (usually .sr* files). Each file corresponds to a specific PowerBuilder object and contains its source code. For example, a window object named w_main would have a corresponding w_main.srw (window source code file), instead of storing all object source codes in a single large PBL file.
Pcode is stored in a separate directory. The compiled Pcode for each object is stored as a binary file and is kept in its own directory (typically under ".pb" and "build" directories) separate from the source code files.
.pb and build folders
In the solution format, the ".pb" folder is used to store intermediate files generated during the compilation process, such as Abstract Syntax Trees (AST) and intermediate Pcode files. During incremental build and save operations, the .pb folder updates only the files that have changed. However, during a full build, the .pb folder is completely regenerated. All Pcode files are stored in the .pb/xxx/obj directory, which is used for compiling the final Pcode, and the AST files are stored in the .pb/xxx/ast directory.
The "build" folder stores the final Pcode files. The final Pcode files will be loaded when the user edits or runs the object or opens the Browser window in the IDE.
These two folders will be automatically ignored when the solution is added to version control from IDE.
Adding a file to the PBL folder
In the solution format, it is unsupported to import objects into the PBL folder via ORCA.
To add a file/object to the PBL folder, you must right-click on the PBL folder in the System Tree and select the "Import From Library" option.
Alternatively, you can add a source file -- such as a .sr* file, which represents the PowerBuilder object -- directly to the PBL folder using a file explorer or version control system. When the PowerBuilder IDE is reopened, the object will appear in the System Tree. Please note that IDE does not validate the file name when loading and displaying the object in the System Tree. Incorrect file names -- such as those containing spaces or special characters -- may result in compilation errors.
Referencing shared PBL folder
In the solution format, multiple projects can share the same PBL folder, similar to how PBL files are shared in the workspace format. And changes (such as adding or deleting objects) in one project will be synchronized to the other projects.
However, the best practice is to separate the PBL folder for each project, or generate and reference PBD in the projects.
Note
Referencing PBL file (as an external file) is also supported in the solution format.
Referencing PBD file
In the solution format, referencing PBD (PowerBuilder Dynamic Libraries) is supported. To do this, open the Project Properties page, select "Convert & Add," and choose the option to add a PB Dynamic Library (*.pbd). This allows users to include PBD files in their solution, similar to how they were used in the workspace format. Please note that objects in the referenced PBD cannot inherit from or reference objects defined in the current project; any such reference will result in compilation errors.


