You are currently browsing all posts tagged with programming

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 »

PowerBuilder ‘Gotcha’ – Selectionchanging event on Tab controls

Posted on September 27, 2011 at 8:19 pm in

Selectionchanging is an event on a tab control which is triggered, according to PowerBuilder help, ‘when another tab is about to be selected.’ From this description you might think that this means changing from one tab to another; this is only partially correct. This event is triggered also when the window opens. Depending upon your…

PowerBuilder ‘Gotcha’ – Selectionchanging event on Tab controls - the full story »

Calculate the Last Day of the Month

Posted on September 16, 2011 at 8:20 pm in

Here is how to calculate the last day of the current month. Powerbuilder date ld_eom ld_eom = RelativeDate(Date(String(Month(Today()) + 1) + "/1/" + String(Year(Today()))), -1) SQL Server SELECT DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, Getdate()) +1, 0)) I quess SQL Denali has a new function (EOMONTH) to do this too. SELECT EOMONTH(GETDATE())

Calculate the Last Day of the Month - the full story »

Joining to a Table Function in SQL Server

Posted on September 9, 2011 at 8:20 pm in

Following up on my previous post, SQL Server (since version 2005 while in SQL 90 compatibility mode) provides the ability to join to the table created by a parameterized table function. In earlier versions you were not able to use a table function with a dynamic parameter or even join to it. If you needed…

Joining to a Table Function in SQL Server - the full story »

Splitting up a String or Text in SQL

Posted on September 9, 2011 at 8:15 pm in

Here is a way to split up a block of text and return a result set based on a delimeter. A table function is used to do the ‘heavy lifting’ and, utilizing some newer features of SQL Server (2005 and 2008), you can even join to it providing for even greater flexability. This situation I…

Splitting up a String or Text in SQL - the full story »

Top