Corrections and additions to PowerBuilder 6: A Developer’s Guide by David McClanahan.

 

 

ERRATA

 

P128

NOTE 1: Having the Library painter open will not prevent the project build. But all other painters must be closed.

 

P284

CONTROLS.APP should be CONTROL1.PBL

 

P316

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.

 

P298-299

Before you code the w_second.Open event, you must define the wf_init_ddlb function that follows.

 

P301-302

st_target.DragDrop event. Copy the code from the example application, there are several typos in the printed code.

 

P357

“and the SQLCA.DBErrText “ should read “and the SQLCA.SQLErrText”

 

Page 426

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.

 

P595

the Data Window Modify function is not necessary. You can use the dot notation syntax. So instead of

 

dw_1.Modify(“datawindow.querymode = yes”)

 

use

 

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

 

P708

Use the code which follows for the w_main.dw_1 ItemFocusChanged event.

 

First create an instance variable;
datawindowchild idwc

 

string s_column

string s_expression

string s_region

int i_rc

 

s_column = dw_1.getcolumnname ()

IF s_column = 'state' THEN

                s_region = dw_1.object.region[row]

                IF IsNull(s_region) THEN

                                MessageBox('Error', &

                                                                'You must select a region before selecting the state')

                                i_rc = SetColumn('region')

                                return

                END IF

                s_expression = "region = '"+ s_region + "'"

                i_rc = idwc.SetFilter(s_expression)

                IF i_rc <> 1 THEN

                                MessageBox('Error', 'Filter Error')

                ELSE

                                idwc.Filter( )

                END IF

END IF

 

 

 

Additions

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