It may seem as if PowerBuilder programmers are bound to use global variables.
Even the PFC, which is said to be the most successfully designed
object-oriented framework, requires the use of global variables. Is it
something in the nature of PowerBuilder that makes us use them? I won't
discuss whether it's good or bad to use global variables as enough has been
said on this subject. However, I am going to discuss why global variables are
usually used in PowerBuilder applications and how we can live without them.
When Global Variables Are Used
Let's face it, if you use global variables, it means you need them. I have
come across two cases in which global variables are used in PowerBuilder
applications. The first case is the need to have a named literal value
referenced by many objects of an application that is referenced globally. As
will be shown later in this article,... (more)
When I was just starting my career in programming, I thought I would be
creating new applications. And I did - I created a few applications from
scratch. Maybe two or three of them. But for the most part what I've been
doing is working with code written by someone else a while ago - legacy code.
What is legacy code? You could define legacy code as ancient applications
that were written in the past. For me, legacy code is code written by someone
else no matter how long ago - 15 years or 15 minutes. What's common about all
applications that were written by someone else? You don't kn... (more)
PowerBuilder Developer's Journal
A picture is worth a thousand words. We all have heard this saying a
countless number of times. But what if you don't understand what is drawn in
the picture? I was approached once with a request to review requirements
specifications for some module. The document contained a scheme that
represented the place of the module within the system. The picture was mainly
made of rectangles and arrows. The rectangles had labels and I figured out
that they represented other modules in the system. But I couldn't understand
the meaning of the arrows. When I ... (more)
DataWindow display formats aren't a big secret. Most PowerBuilder developers
use them to format numeric, date, time, and string values properly. Such
display formats are usually straightforward and contain characters that have
special meaning for a specific datatype like '#' for numeric values or '@'
for string values. However, the DataWindow display format is a very powerful
tool and you can get more than simple data formatting. This article explores
what you can do with DataWindow display formats demonstrating a few tricks.
Using Regular Characters
A DataWindow display format ca... (more)
PowerBuilder has a very handy way to make data entry more convenient: the
DropDownDataWindow and DropDownListBox edit styles for DataWindow columns.
Indeed, it's much simpler to pick up a value from a look-up list than to type
it in each time you need to enter it. However, it looks like we've overlooked
one of the cases when use of a drop-down list can make data entry easier for
Most of the time we use drop-down lists when working with lists of pairs
"encoded value"/"decoded value": the users see and select decoded values and
encoded values are saved in the database. T... (more)