Normally I try to write applications on the DataWindow or Appeon but every
now and then I get a question that makes me sit back and say, "Huh?"
In this case the question concerns the PostOpen event. I've seen that event
named different things: ue_post_open, postOpen, post_open, ue_postOpen, etc.
It has, as far as I can see, always had post and open in the name of the
event. Further, just about every framework that I've ever seen has had that
event in the base window.
The question that I was asked was, "Why is that event there?"
The programmer wanted to know why there was code in the post open and why was
it not just put at the end of the open event? At first I was really confused
by the question. It was like he was asking me why do we have arrays? I just
couldn't imagine not knowing the answer.
Then it occurred to me that I learned the answer to that question from a ... (more)
We are going to create a bare-bones email object. Of course you can expand
that in the future if you like, but for now, let's just create the
functionality that we need.
I start by creating a custom class. In case you aren't familiar with the
process look at Figure 1.
Let's start with an instance variable.
N_cst_mailer Instance Variables
private mailMessage io_mail_message // The message to send
I made the instance variables private so let's write a couple of functions to
populate our mail Message. We'll start with the TO. Note that the
io_mail_message contains an array of objec... (more)
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(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)
One of the most useful custom objects that I've ever written is my
master_detail object. It holds a prominent place in my toolkit. This article
will take you through the steps of how to write one and in the process
de-mystify the object.
First we want something that looks like Figure 1. Selecting a row in the top
DataWindow will display the details in the bottom. I'm sure that you've seen
this kind of DataWindow and you've probably written many of them. The key
here is not to tell you how to write this but how to simplify every one that
you will write in the future. For our exam... (more)
Have you ever seen a form that has its own microhelp that changes when a
field gets focus? I'm sure you have. You might see a window and at the bottom
of the window is a line that says, "OPTIONAL - Enter the employee birth
date," when a field is entered. We are going to create a simple automated
solution that will allow you to carry the microhelp along in the DataWindow.
Take a look at Figure 1. It's a freeform DataWindow with a SQL data source. I
chose the Employee table from the sample database that comes with
PowerBuilder. I didn't do anything special to it. My goal here is to ... (more)