You are currently browsing the Programming category

PowerBuilder – Discarding Rows with Find

Posted on May 10, 2012 at 5:37 pm in

It’s a fairly common practice to report on a set of data derived from a larger group of rows. There are many techniques to do this in code and with the methods available with datawindows/datastores. One typical approach is to use the Filter method. The problem with this is it requires another trip to the…

PowerBuilder – Discarding Rows with Find - the full story »

PowerBuilder – Determining if Controls Overlap

Posted on May 2, 2012 at 5:32 pm in

I had a situation where I needed to know if the user is clicking on a control which is underneath a rectangle on a datawindow. In this case the interior of the rectangle was transparent. ls_name = dwo.name IF (left(ls_name, 2) = 'r_') THEN // my standard rectangle naming convention ls_objects = this.Describe( 'DataWindow.Objects') ls_objects…

PowerBuilder – Determining if Controls Overlap - the full story »

PowerBuilder – Fontheight method in Expressions

Posted on February 29, 2012 at 2:29 am in

An enhancement was put into PB12.1 dealing with determining the height of a datawindow column based on its font setting. It’s called Fontheight and takes a string parameter. Unfortunately there does not appear to be any documentation on it in the PB help files (I’m looking in PB12.5). You can see a reference to it…

PowerBuilder – Fontheight method in Expressions - the full story »

Coding for Amateurs

Posted on February 27, 2012 at 5:02 pm in

Bumped into this code the other day. Hmmmm… //b_paint_good is a boolean set somewhere else IF NOT b_paint_good THEN //do not do something here [code follows] ELSE // do something here [more code follows] END IF Now what’s the point of this? Trying to raise the defect count on your software (in the immortal words…

Coding for Amateurs - the full story »

PowerBuilder – Finding special folders – FDCC Compliance

Posted on February 14, 2012 at 6:03 pm in

Here is a link to an article by Bruce Armstrong (since broken) relating to new functionality in PB11.5.  The article specifically deals with FDCC (Federal Desktop Core Configuration)  Compliance in PB apps and specifically the SHGetFolderPath Windows API function.  Although this information has been available for awhile, it’s worth noting again. Usage Notes: function ulong SHGetFolderPath(ulong hwndOwner,…

PowerBuilder – Finding special folders – FDCC Compliance - the full story »

PowerBuilder – More Datawindow Mouseover Effects

Posted on February 9, 2012 at 8:24 pm in

So I download the latest Chrome browser beta the other day (v17) and I notice a neat effect on the tabs prior to applying my custom settings. A gradient centered on my mouse pointer passed across the tab as I moved it. It was very subtile but noticiable if you were paying attention. Naturally I…

PowerBuilder – More Datawindow Mouseover Effects - the full story »

PowerBuilder – Getting Database Identity Values after Multi Row Inserts from Datawindow

Posted on December 22, 2011 at 7:40 pm in

This is a technique to use when you have a data entry window in which multiple parent records can be inserted along with multiple child records for each parent and your tables have their record keys set up as identity values. The database in question for this discussion is SQL Server. This figure shows a…

PowerBuilder – Getting Database Identity Values after Multi Row Inserts from Datawindow - the full story »

PowerBuilder – Datawindow Drag/Drop Rows with Business Rules

Posted on December 21, 2011 at 12:40 pm in

This time I’m demonstrating a basic bit of functionality common to many Windows based applications – drag and drop. In this case I am talking about the ability to drag a row of data to a new location in a list. However, to make it more interesting I am throwing in some business rules which…

PowerBuilder – Datawindow Drag/Drop Rows with Business Rules - the full story »

PowerBuilder Assertion Failure

Posted on October 26, 2011 at 8:04 pm in

Here is a minor head scratcher in PB11.5. IF Len(dw_1.object.column_name[1]) > 50 THEN // and so on This gives you a nifty messagebox: To fix this do something like: IF Len(string(dw_1.object.column_name[1])) > 50 THEN… or string ls ls = dw_1.object.column_name[1] IF Len(ls) > 50 THEN… Since there are two Len methods (one for blob and…

PowerBuilder Assertion Failure - the full story »

PowerBuilder – Datawindow ‘SuperSpy’ tool

Posted on October 7, 2011 at 8:20 pm in

Not too long ago I came across some information on a free Powerbuilder tool call ‘DWSpy’ written by Michael Zuskin (site is gone now apparently). In certain respects it is similar to my Window Object information service although geared towards datawindows. I decided to expand on the tool a bit by changing it into a…

PowerBuilder – Datawindow ‘SuperSpy’ tool - the full story »

Top