Corrections and additions to PowerBuilder 6: A Developer’s Guide by David McClanahan.
NOTE 1: Having the Library painter open will not prevent the project build. But all other painters must be closed.
CONTROLS.APP should be CONTROL1.PBL
NOTE 1: When PowerBuilder refers to any complex object (such as Windows, UserObjects and Structures) by it’s name, the name is a pointer to that object, not the object itself. You can pass that pointer by “reference” or by “value”. The “by reference” is actually a pointer to a pointer. Is that clear? See the section “Understanding PowerBuilder Object References” in Chapter 17 for a very complete discussion.
Before you code the w_second.Open event, you must define the wf_init_ddlb function that follows.
st_target.DragDrop event. Copy the code from the example application, there are several typos in the printed code.
“and the SQLCA.DBErrText “ should read “and the SQLCA.SQLErrText”
Function wf_open_file will not compile correctly because, at this point in the development, you have not yet created the m_main.mf_enable_file_options and m_main.mf_mru_list functions. At this point simply comment out the two statements. Complete the coding of the m_main menu and then uncomment the lines. This is a common technique in PowerBuilder development.
the Data Window Modify function is not necessary. You can use the dot notation syntax. So instead of
dw_1.Modify(“datawindow.querymode = yes”)
dw_1.object.datawindow.querymode = ‘yes’
Another example (not used here) would be a similar method to avoid the dw.Describe function
s_num = dw_1.object.datawindow.column.count
Use the code which follows for the w_main.dw_1 ItemFocusChanged event.
First create an instance variable;
s_column = dw_1.getcolumnname ()
IF s_column = 'state' THEN
s_region = dw_1.object.region[row]
IF IsNull(s_region) THEN
'You must select a region before selecting the state')
i_rc = SetColumn('region')
s_expression = "region = '"+ s_region + "'"
i_rc = idwc.SetFilter(s_expression)
IF i_rc <> 1 THEN
MessageBox('Error', 'Filter Error')
To have PowerBuilder open the Library painter at startup, use the “/p library” command line parameter:
"C:\Program Files\Sybase\PB6\pb60.exe" /p library
First DataWindow Applications
Note: In development, the database to which PB will connect (by default) is the last used DB.
This may not be the DB for which the DW was designed.
(ODBC.INIPS_DSN exist failed) – powerbuilder is not installed