Schultz’s PowerBuilder Notes

Sybase and Nulls


If you have not read about how PowerBuilder treats nulls, you may want to read  nulls first.

Continue reading

Advertisements

January 7, 2009 Posted by | Database | , , , , | 1 Comment

Nulls


I find nulls to be the cause of so many bugs. Here are a few things that have helped me get my mind around this surprisingly confusing topic.

Let’s look at the following script, what would the result be?

Continue reading

August 14, 2008 Posted by | Powerscript | , , , | 2 Comments

Changing an Object’s Ancestor


I was once in a code review and I noted that the custom object that was built should be inherited from n_base so it can inherit the constants SUCCESS, FAILURE and NO_ACTION.

Continue reading

July 14, 2008 Posted by | 1. PowerBuilder General | , , , , , | Leave a comment

PFC DataWindow Multi-Table Update Service


I worked with PowerBuilder for over 7 years before I ever needed to do a multi-table update. Then I moved to a team which uses it all over the place. Go figure.

Continue reading

July 2, 2008 Posted by | 3. PFC, Datawindow Services | , , , , , | Leave a comment

ItemChanged Event


Return codes

Return Code

Action

0

Accept the data value

1

Reject the data value

2

Reject the data value but let the focus change

Continue reading

May 29, 2008 Posted by | DataWindow Control | , , , , , , , , | Leave a comment

DataWindow Script Techniques


How do I set a property for an entire column?

Modify(“shft_id.visible = 0”)

Modify(“shft_desc.protect = 1”)

Continue reading

May 26, 2008 Posted by | 2. Datawindows, Datawindow PowerScript | , , , , , , , , , , , , , , , , , , , , , , , , , , , | 8 Comments

System Functions


Evaluate( )

The evaluate( ) function is available for use with Describe( ). Evaluate( ) lets you evaluate DataWindow expressions within a script using data in the DataWindow. It has the following syntax:

Continue reading

May 26, 2008 Posted by | Powerscript | , , , , , , , , , , | Leave a comment

Dynamic DataWindows


How do I build a DataWindow dynamically?

  1. Build the SQL statement for the DataWindow object as a string and describe he form and presentation style of the DataWindow object
  2. Associate the new DataWindow object with a DataWindow control

Continue reading

May 26, 2008 Posted by | 2. Datawindows | , , , , , , , , , , , | 5 Comments

Groups and Grouping


How do I dynamically change a group property?

ll_color = RGB(200, 200, 500)

dw_1.Modify(“DataWindow.Header.2.Color=” + String(ll_color))

dw_1.Modify(“DataWindow.Trailer.2.Height=500”)

Continue reading

May 25, 2008 Posted by | Datawindow PowerScript, Presentation Styles | , , , , , , , , , , , , , , , , , | 4 Comments