Library
File ▸ Open Library (Ctrl+O,
tool bar Open) opens a single library on its own tab,
to read rather than to compare: a .pbl, a
.pbd, or a built .exe or .dll
with libraries appended to it. Dropping one library onto the window does
the same. To compare two libraries, give both to New Comparison instead; Two releases of a library does both.
The list
The entries are listed in five columns: Name, Type, Size, Modified (UTC) and Comment. Each entry is source, compiled or a resource; Reading PowerBuilder libraries says what pb-diff can do with each kind.
The tab adds two controls to the tool bar for narrowing a list that can run to thousands of entries: Source only, which hides the compiled and resource entries, and a search box, which narrows the list as you type. Ctrl+F puts the keyboard in the search box.
Validate and export
The tab also puts Validate Library and Export Objects in the bar, as Validate and Export; their tool tips say what each does. Both act on the library on the tab in front, and are on the Tools menu as well.
Tools ▸ Validate Library walks the container's structure and lists what it finds beneath the entries, each finding an error, a warning or an observation with a stable code and the object it is about. Libraries do get damaged: an interrupted save, a bad network copy, a fifteen-year-old file that has been optimised a thousand times. Run it before spending an afternoon wondering why an object will not export. To check every library of an application at once, use Tools ▸ Verify Libraries; see Check libraries for damage.
Tools ▸ Export Objects writes source entries out as
.sr* files PowerBuilder will import: the
$PBExportHeader$ line, the entry's comments, the right
encoding, and the companion binary part where the object has one. You
choose the folder to export into.
The same from the command line:
pb-diff-cli info ui.pbl # flavour, version, comment, counts
pb-diff-cli list ui.pbl --format json # every entry with kind, size, time
pb-diff-cli validate ui.pbl --format json # findings with stable codes
pb-diff-cli validate app.pbw # every library of the workspace
pb-diff-cli export "ui.pbl!*.srw" --out-dir .\windows # importable .sr* files
pb-diff-cli export "ui.pbl!w_main.srw" --stdout # one object, to standard output
validate exits with 0 when every library is clean, 1
when there are warnings only and 2 when a library is damaged, unreadable
or missing.
The library is opened read-only. pb-diff never writes to a library, and it does not need the library to be closed in the IDE; comparing or reading one that PowerBuilder is actively writing to gives you whatever happened to be on disk at that moment.