Richard (Rik) Brooks

Subscribe to Richard (Rik) Brooks: eMailAlertsEmail Alerts
Get Richard (Rik) Brooks via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Top Stories by Richard (Rik) Brooks

Service objects were introduced for PowerBuilder at about the same time as the PowerBuilder Foundation Classes. Much like the PFC, most programmers found reasons not to use them. In this article we will reduce the complexity of these objects and in so doing perhaps open a new world of efficient objects that are easily maintained and understood. This article is going to create a service object for the DataWindow. The idea behind this object and others like it is to minimize the footprint of the DataWindow. We want to minimize the amount of memory that the DataWindow requires and thus provide the greatest responsiveness that we can. One of the most used areas of functionality for a PowerBuilder programmer is row selection for the DataWindow. How many times have you gone to the Clicked event of a DataWindow control and typed something like the following? This.selectRow(... (more)

DataWindow Sorting with Column Headers

This article describes how to create a grid presentation window that allows sorting by clicking on the column header. To begin we need to create a grid DataWindow. I'm selecting just a few columns from the employee table. Here is my sql for the DataWindow in Figure 1. Once we have created it I get the DataWindow painter shown in Figure 2. There are several changes that we need to make. Let's change the status column so it's no longer a set of radio buttons. This is a read-only screen so let's remove the status and add a computed field. To do this let's remove the Status column ... (more)

Dancing Checkboxes

Normally I write columns about the DataWindow or Appeon. This month though I ran into an interesting little logic problem and when I solved it I realized it was really a nice piece of code so, even though it is not in my normal genre I thought I'd share it. I was tasked with allowing the user to pick a combination of days of the week with these specifications. The user may select no more than three days prior to today. The user may select no more than three days in the future. The user may not have both prior and future dates in the same group If there are not three days in the ... (more)

Appeon Developer Configuration

Have you ever used a datastore that ran without a problem while you were developing your application, but once you've compiled it stopped running? Let me tell you that's a difficult bug to fix. I remember it so well. I kept going back and forth. How in the world could the DataWindow work at design time yet not in the executable? I remember that I checked the return value of the datastore. I finally noticed that the datastore returned a -1. That's such a strange thing. The datastore returns the number of rows that were returned or a -1. The help files used to say that a -1 was in ... (more)

Automating Your DataWindow

Every programmer knows about the IF command. It's pretty much a fundamental part of the syntax of every computer language that has ever existed. I don't need to explain how it works. The DataWindow can't use the IF command though. It does, however, support an IF function. IF(expression, TRUE, FALSE) In its simplest form this means that if the expression evaluates to TRUE, then whatever statement you supply for the TRUE part is executed. If not then the FALSE part is. Let's begin with a simple example. Let's create a DataWindow that will show employee information. Here is the SQ... (more)