Simply Clarion - Converting 2.003 to C5 ABC - Part 1

By Don Reynolds

Posted December 1 1998

Printer-friendly version

Download the code here

Scenario

You have been busy programming many systems using the CW2.003 template set. You now want to make some enhancements to these systems and convert these programs to C5 ABC to take advantage of the object oriented programming in the ABC classes.

How much of a task will this be? You decide to find out. Pondering the various applications you have created, you select one which is not too simple, yet not too difficult. This will be the basis for your conversion test.

The Application Converter

This gem of a tool allows you to convert from a CW2.003 application to a C5 ABC application. You go to the User's Guide, page 525, and read how to use this tool.

The directions seem fairly simple. You decide to run your application through the converter. As you do so, you find proposed changes to your code. The original code appears on the left; the suggested Clarion ABC Source Code appears on the right.

Benefit #1: Code Conversions

As you complete this process, you find most, if not all, of your code has been converted to the ABC formats. You recompile your program in ABC mode and you're ready to continue on in adding enhancements to this system.

This is the primary purpose of the Application Converter. It has done its job admirably. However, you always like to get the most value for your investment, so you ask yourself if there is not more you can get from this tool.

Benefit #2: A Conversion Teacher

You note that if the configuration for rules is set to Automatic, the Application Converter makes all the changes without letting you know which specific things are changing. This is fine for someone expert in the rule base; however, you are somewhat new to this, so you set everything to manual.

This displays each suggested change and gives you a chance to 'APPLY' it or not. You find some things are no longer used in the ABC templates, other things are renamed. You check to see if the application converter will also convert embedded code, and you're pleasantly surprised that it does.

Your Particular Coding Practices

One of the nice things about the Application Converter is that the suggested changes precisely reflect your coding practices. This includes both your use of the templates and your coding style within embeds. Language constructs you don't use do not show up. Yet a different programmer, using these constructs, would find them in his conversions.

Benefit #3: Documenting your conversion standards

After the excitement of seeing whether the converted program works, you decide you want to record all of the unique suggestions made by the Application Converter. A few reasons come to mind:

  1. You might forget the suggested syntax change
  2. Others can build on what you have learned...so each person does not have to learn it personally.
  3. When exceptions occur, these can be documented with your shop standard resolutions.
  4. As you write new embed code in ABC, this will give you a translation table from the code you are used to writing to the object-oriented syntax.

A Possible Documentation Strategy

You decide to reconvert your first application and record all the unique suggestions on a piece of paper. Eventually this ends up being multiple pages. But the pages can be quickly copied for other programmers working on your systems.

Of course you make sure that the first five characters of each new application you convert to are unique so that the generated .CLW files will not conflict.

An Online Documentation Strategy

Using the Upgrade.exe program, you could switch back and forth between it and the Application Converter, recording the unique changes you find.

The Upgrade program is a simple program, which looks like this:

DR120101.gif

Choosing Browse, Conversion rules we get the following list box:

DR120102.gif

Pressing Insert takes us to a Form:

DR120103.gif

Which appears on the list box as follows:

DR120104.gif

The '**' indicate that a comment exists for this particular conversion. Putting several conversion rules would look something like this:

DR120105.gif

Of course a report can be generated.

DR120106.gif

Summary

We can gain more from the Application Converter by recording its suggestions into a database available for all to use. This will help us in our future conversions and ABC code writing. Use of a small upgrade program lets us trap these suggestions.

Article comments

Post a comment

You must be logged on to post comments.

Clarion Roadmap

Try the roadmap (beta)

Search ClarionMag

 

Advanced search

From the archives

Sending Clarion Reports as Email Attachments (Part 1)

1/9/2001 12:00:00 AM

The email capability in version 5.5 is a nice addition to the Clarion toolset. What is still missing however, is the ability to easily send a report as an email attachment. In this article David Potter demonstrates one possible solution to this problem. Part 1 of 2.