About this chapter
This chapter describes two tools provided with the PBNI SDK:
-
The pbsig190 tool gets the internal signature of a PowerBuilder function from a PBL name.
-
The pbx2pbd190 tool generates a PBD from a PBX.
When you install PowerBuilder, these tools are installed in the SDK subdirectory of your PowerBuilder 2019 R3 directory (%AppeonInstallPath%\PowerBuilder [version]\SDK).
Description
The PowerBuilder function signature is the internal signature of a PowerBuilder function that is used to identify polymorphisms functions in a class. The pbsig190 tool obtains these function signatures from a PBL.
Inherited functions
You can also obtain a signature by selecting the function in the System Tree or Browser and selecting Properties from its pop-up menu. The pbsig190 tool does not report the signature of functions that are inherited from an ancestor object unless they are extended in the descendant. For such functions, you must use the Properties dialog box to obtain the signature. The Properties dialog box in the Browser also allows you to obtain the signature of PowerBuilder system functions.
Syntax
pbsig190 pbl_name
Examples
This command extracts function signatures from one of the PBLs in the Code Examples sample application:
pbsig190 pbexamw1.pbl
Here is some of the output from the previous command:
PB Object Name: w_date_sort public subroutine of_sort (string as_Column, string as_Order) /* QSS */ PB Object Name: w_date_window public function boolean of_is_leap_year (integer ai_year) /* BI */ public subroutine of_days () /* Q */ PB Object Name: w_dde_server public subroutine check_hotlink (checkbox status, string data, string item) /* QCcheckbox.SS */ PB Object Name: w_dir_treepublic function integer wf_collapse_rows (datawindow adw_datawindow, long al_startrow) /* ICdatawindow.L */ public function long of_recurse_dir_list (string as_path, long al_parent) /* LSL */ public function string of_build_dw_tree (long al_handle) /* SL */
The following example illustrates the use of a letter code to represent a PowerBuilder system class or a custom class. Consider this function:
function integer of_get_all_sales_orders (Ref s_sales_order astr_order[], date adt_date, integer ai_direction)
For this function, the pbsig190 tool returns the following string. The first argument is an unbounded array of type s_sales_order and is passed by reference:
/* IRCs_sales_order.[]YI */
Usage
The pbsig190 tool generates a string that represents the declaration and signature of all the functions and events in the PBL, including argument types, return types, and passing style. Each function and event is followed by a commented string. You pass the commented string, for example, QSS in the first comment in the previous example, as the last argument to the GetMethodID method.
For example, the following output indicates that the function returns an integer and has a single integer argument passed by reference:
/* IRI */
PowerBuilder arrays
PowerBuilder arrays are indicated with a pair of square brackets [ ] as a suffix. For bounded arrays, the brackets enclose the bounds.
/* IRCdatastore.RS[]SS */
PowerBuilder system or custom class
Additional letter codes represent a PowerBuilder system class or a custom class. The letter C followed by the name of a PowerBuilder object or enumerated class and a period (Cname.) represents an argument or return value of that type.
The following table shows how the output from pbsig190 maps to datatypes and other entities.
Output |
Datatype |
---|---|
[ ] |
array |
A |
any |
B |
boolean |
C |
class |
D |
double |
E |
byte |
F |
real |
G |
basictype |
H |
character |
I |
integer |
J |
cursor |
K |
longlong |
L |
long |
M |
decimal |
N |
unsigned integer (uint) |
O |
blob |
P |
dbproc |
Q |
No type (subroutine) |
S |
string |
T |
time |
U |
unsigned long (ulong) |
W |
datetime |
Y |
date |
Z |
objhandle |
The passing style is indicated by a prefix on the type.
Prefix |
Meaning |
---|---|
None |
Pass by value |
R |
Pass by reference |
X |
Pass as read only |
V |
Variable arguments (varargs) |
Description
The pbx2pbd190 tool generates a PowerBuilder dynamic library (PBD) file from a PowerBuilder extension PBX. The generated PBD can be added to the library list of any PowerBuilder application target that will use the objects and methods in the PowerBuilder extension.
Syntax
pbx2pbd190 [+] des.pbd src1.pbx [ src2.pbx src3.pbx ...srcn.pbx ]
Examples
This example generates a new PBD test.pbd from test.pbx. The input and output files are in the current directory:
pbx2pbd190 test.pbd test.pbx
This example appends generated information from C:\myproject\src.pbx to C:\mypbds\des.pbd. (If des.pbd does not exist, it is created.)
pbx2pbd190 + C:\mypbds\des.pbd C:\myproject\src.pbx
This example generates a new PBD D:\pbds\test.pbd from all the PBX files in the C:\myproject directory:
pbx2pbd190 D:\pbds\test.pbd C:\myproject\*.pbx
This example generates PBD information from all the PBX files in the C:\temp and D:\temp directories and appends the information to the existing generated PBD file D:\pbds\test.pbd:
pbx2pbd190 + D:\pbds\test.pbd c:\temp\*.pbx d:\temp\*.pbx
Usage
You can import an extension into a PowerBuilder library using the Import PB Extension pop-up menu item for the library in the PowerBuilder System Tree. Prior to PowerBuilder 11.5, you had to use the pbx2pbdnnn tool to create a PBD file from a PBX file, then add the PBD to the library list of your PowerScript target. The tool is still available in this release.
You can include multiple PBXs in a single PBD file. If you want to add additional PBXs to an existing PBD, use the plus (+) sign before the name of the PBD.
The pbx2pbd190 tool is installed in the system PATH in the %AppeonInstallPath%\PowerBuilder [version]\IDE directory so you can invoke it in the directory where the PBXs reside.
If you specify an absolute path for the PBX file when you generate the PBD, the PowerBuilder application searches for the PBX only in the specified path.
If you do not specify the path for the PBX file, the PowerBuilder application searches the system path for the PBX.