A typical PowerBuilder application has a few zillion MessageBox() calls. This
article explains how you can roll your own MessageBox() function, replacing
the native PowerBuilder MB() function with your code.
Why would you want to write your own MB() function? The general reason is to
give you a "hook" where you can write code to modify the native Windows MB()
behavior. Let's face it, the MB() has evolved about as rapidly as the shark,
like, not at all since PB 1.0.
And the MB() needs to evolve. Among the native MB()'s deficits:
It provides no way to get the text: you can't copy the text on a MB() into
the clipboard. It handles long messages badly: the buttons are below the
bottom of the screen; and Most aggravating, the PB MB() doesn't display if
either its title or text is NULL! How many times have you been burned by that
last "feature"? Doh!
For these and other rea... (more)
Overloading allows two or more functions to have the same name and return
type, if their signature is different. The function signature is defined by
its number and types of arguments. When you call an overloaded function,
PowerBuilder decides which version of the function to call based on the
function signature. This can be exploited to determine an object's type at
runtime. This article presents a couple of practical applications of this
technique, and describes a third situation where a different technique is
required.
Technique 1:
Validating Arguments
I first used this metho... (more)
How does your organization manage its PowerBuilder source? Your application
has several PBLs containing several hundred objects. Do you use the native
PowerBuilder check-in/checkout? Do you employ a "real" revision control
system, such as Microsoft's Visual SourceSafe?
These traditional techniques don't work for our organization because we do a
lot of off-site development. Developers may be traveling, writing code in the
plane or at the client site. A couple of us routinely work from home where we
don't have remote access to the office network. Therefore we apply a rather
Neande... (more)
It's an aesthetic thing. When you click on a grid DataWindow label and change
an attribute, it acquires what are formally termed UGBs - Ugly Grid Borders.
They appear between the labels in the grid header. The vertical lines are
thin or thick. Inconsistency! Thick borders! Yuck! Figure 1 illustrates the
problem.
There are thick borders between the Nickname and Last Name labels and between
the Company and Nickname columns; there are thin borders between the Company
and Nickname labels and between the Nickname and Last Name columns.
Figure 2 shows the same DataWindow with the UGBs ... (more)
Roland Smith's PBSearch utility is the tool to turn to when you need to find
a string in your PowerBuilder application. For example, if you have an error
message from a bug report, it takes PBSearch only a few seconds to find all
the instances of that message. Similarly, if you want to see usage examples
for a given function, PBSearch will quickly find and show you the places
where that function is called in your application.
As such, PBSearch is analogous to the Object Searcher in the Advanced
PowerBuilder Utilities that Sybase used to distribute with PB. PBSearch is
much faste... (more)