Welcome!

PowerBuilder Authors: Chris Pollach, Yeshim Deniz, Jayaram Krishnaswamy, Kevin Benedict, Avi Rosenthal

Related Topics: PowerBuilder, Microsoft Cloud

PowerBuilder: Article

Crazy Eights: Migrating a Legacy Application up to PowerBuilder 12 .NET

A legacy application with distant roots in PB version 4

I grew up in a Brooklyn NY apartment building. As a young kid, one of my rainy day after-school pastimes was playing card games with the other kids in my building. One of the games we played was crazy eights. If you're curious about this simple card game, check out the Wikipedia description at http://en.wikipedia.org/wiki/Crazy_Eights

Recently I was tasked with migrating a legacy application with distant roots in version 4, up to PowerBuilder 12 .NET. The trip over to version 12 Classic went fine with nary a hitch. The ride over to .NET was not too bumpy either. But then I started to exhaustively drive the code. Figure 1 shows a screenshot of part of a DataWindow that forced me over to the liquor cabinet to get the gin. Most of the numbers look normal, but then I noticed those crazy [8]s in the balance, weight and price objects. To make sure it wasn't something I hadn't notice before migration, I went back to the classic version. Figure 2 shows the same DataWindow object in the Classic version. As you can see, it doesn't have the crazy [8]s.

Figure 1: Crazy [8]s in the .NET DataWindow display

Figure 2: Classic version without the [8]s

This one drove me crazy until after an hour at the card table with my elementary school buddies playing nostalgic games of crazy eights and drinking gin (told them it was ginger ale). When I looked at the DataWindow Object source, everything looked normal. Figure 3 shows the Classic source. After staring at it for a while I noticed a key difference: the data in the classic version was displaying in a shade of blue and the .NET data was black. The blue color was rendered by the RGB value 8388608 in the format color code.

Figure 3: Classic DWO format

Then I had a flash of insight. The [8] in the .NET display was the literal output of the format color code! The DataWindow format expression wasn't recognizing the color code.

In a fit of madness, I turned to the HTML help topic and found these words (shown in Figure 4) - "specifying a color keyword before the format...." That's funny! I didn't think the format evaluated cared where they were.

Figure 4: Help description

Whoever rewrote the .NET DataWindow engine followed the written rules. Quickly I tested my theory by moving the color code before the format string. Sure enough, the crazy [8]s were gone and the numbers were in blue. Figure 5 shows the result.

Figure 5: .NET after moving the color code

Here's my conclusion: the migration does process some great magic to get your legacy code over to .NET. However, one thing it doesn't do is watch out for misplaced color codes in formats. I guess it feels that it's the developer's problem if someone years ago didn't know or follow the written rules. The fact that the Classic DataWindow engine ignored the color code location was just dumb luck. The upshot: you will have to hand search your Classic DataWindow code and scripts for the presence of embedded color codes after formats in object format expressions. Old code with the color codes following the format will have to be manually [email protected]!!

Talk about migration migraines! Cheers, time to deal another hand.

•   •   •

(Note: Sybase engineers have noted that this issue will only be in the GA 12.0 release and is expected to be addressed in the first EBF.)

More Stories By Yakov Werde

Yakov Werde, a 25 year IT industry veteran, is a member of TeamSybase and the newly formed Sybase Customer Evangelist Team. Yakov is a recognized author, speaker and trainer who has been designing and delivering PowerBuilder, .NET, EaServer, Web App Development, and Java training for over 14 years to corporate, military and government developers. Prior to discovering his aptitude as an educator, Yakov worked as an architect, project manager and application coder in the trenches of application software development. Yakov holds a Masters in Education with a specialty in instructional design for online learning from Capella University and a BS in math and computer science from Florida International University. Yakov, managing partner of eLearnIT LLC (www.elearnitonline.com), authors and delivers workshops and web based eLearning tutorials to guide professional developers toward PowerBuilder Classic and .NET mastery. Follow Yakov on Twitter as @eLearnPB

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.