<<Application Conversion>>
Application Conversion

This help section provides the steps to convert a 2.1 application or
3.0 application to utilize the added functionality of the 3.1
template set.

Press the sections button and select the appropriate help section
for your conversion needs (2.1 to 3.1 conversion or 3.0 to 3.1
conversion)


<<2.1 to 3.1 Conversion>>
2.1 to 3.1 Conversion

<Overview>
Overview

The 2.1 templates in CD31.TPL were designed to provide identical
behavior to Clarion Professional Developer's network model file
(NETWORK.MDL). If you have modified NETWORK.MDL or used a different
model file (such as a third-party set) you can import your
application's procedures but internal code and declarations may
differ greatly.

When you import a 2.1 application, the finished product should look
and feel identical to the 2.1 executable, with substantial
performance benefits.

The 2.1 templates do not directly support Referential Integrity
through the Database Dictionary. However, any RI code implemented in
the original 2.1 app (through embedded source code) will import and
work in a similar manner.

<Steps to convert a 2.1 Application>
Steps to convert a 2.1 Application

1) Create a new dictionary.

         a) Choose New from the File Menu (or Press F2).

         b) Mark the Dictionary Radio Button.

         c) Provide a name for the dictionary.

            Tip: Provide different names for the dictionary and
                 application so you can modify the dictionary
                 from the Application generator

         d) Press the Ok button.

2) Import the file definitions from the 2.1 application.

         a) Choose Clarion 2.1 APP from the Import submenu of
            the Edit Menu (or press CTRL+I 2).

         b) Select the .APP file from the File Open window.

            The Clarion 2.1 Files window appears.

         c) Tag the files you want to import by pressing the
            spacebar (or press the Select All button to tag all
            files).

         d) Press the Ok button.

         e) Save the Dictionary and Exit (press CTRL+X and press the
            Yes button when prompted to save).

3) Create a new application using the CD31.TPL template set and the
   dictionary you have just created (Choose New from the File Menu
   and mark the Application radio button).

4) On the Global Properties window, press the Compatibility button.

         a) Check the CPD2.1 check box.

         b) Make sure the Global ACTION check box is checked.

         c) Check the Global OpenFiles check box if you want all
            files OPENed when the application starts.

         d) If desired specify keycodes for the Reject key and
            Accept Key (or accept the defaults).

         e) Press the Ok buttons on the Compatibility window and the
            Global Setting window.

5) Import procedures from your 2.1 application.


         a) Specify the desired setting for Option Strings (Choose
            Options form the Project Menu, or press ALT+O).

            If Option Strings are not enabled, any Option Strings in
            your original application are converted to Radio
            Buttons.

         b) Choose Clarion 2.1 APP from the Import submenu from the
            Edit Menu (or press CTRL+I 2).

            The Import from Clarion 2.1 APP windows appears.

         c) Type in the name and path of your 2.1 application file
            or press the  button to select it from a File Open
            window.

         d) Type in the name of the procedure to import or press the
             button to select one or more for a list.

         e) Tag the procedures you want to import by pressing the
            spacebar (or press the Select All button to tag all
            procedures)

         f) Press the Ok buttons on the Clarion 2.1 Procedures
            window and the Import from Clarion 2.1 APP windows.

            The procedures are imported into your new application
            tree.

         g) If necessary, change the name of your First Procedure to
            match the base procedure imported from your 2.1
            application.


6) Repopulate the modules for the new application.

         The Import process creates one module containing all the
         imported procedures (except for imported "OTHER"
         procedures, see below). Repopulating modules moves
         procedures into separate modules.

         a) Choose Repopulate Source Modules from the File Menu (or
            press CTRL+U.

         b) Specify the desired number of procedures per module,
            then press the Ok button.

7) Check any Procedures which used Record Selectors.

          a) Highlight the Procedure, then press ENTER.

          b) Press the Range Limits button.

             Check the Range Limits to ensure that the import was
             sucessful. Template changes may require some minor
             editing. If needed, make any necessary corrections.

          c) Press the Ok buttons on the Range Limits window and
             Procedure Properties Window.

8)  Make any final modifications (if needed). See 2.1 Conversion issues.


<2.1 Conversion Issues>
2.1 Conversion Issues

Reserved Words

    The Clarion language has grown since CPD 2.1. The enhanced
    capabilities of Clarion for DOS requires additional words be
    made Reserved Words. If your 2.1 application used any field,
    function, or procedure labels which are now reserved words, you
    must change them.

DISPLAY()

    In 2.1 Screen variables (prefixed with SCR:) were part of the
    SCREEN structure. Making an assignment to screen variable
    automatically displayed its new value.

    In 3.1 screen variables are local variables and must be
    explicitly redisplayed using a DISPLAY(?SCR:VariableName)
    statement.

    For the same reason, a DISPLAY() statement in 2.1 did not update
    screen variables. A ROUTINE named Display_Screen has been
    provided to provide this functionality in 3.1.

    To mimic the behavior of 2.1, replace any DISPLAY() statements
    with DO Display_Screen.

Scroll Area (Repeat with Point)

    A screen with a Scroll Area (a Repeat structure with a Point
    field) must have blank spaces in the row to the right of
    the Repeat structure.                                                                                                                                                                                                                                    ^

Other Procedures

    The source code for any imported "OTHER" procedures must be
    converted using CLACNV.EXE. This utility updates legacy source
    code to conform with the 3.1 compiler.

    These procedures retain their original module names when
    imported.


To Convert Source Code files:

1) From a DOS prompt, type CLACNV SrcFile, where SreFile is the
   filename of the file to convert.

2) If the original source code file used a generic MEMBER statement,
   modify it to specify the Module of which it is a member.

   For example,

    MEMBER ()

   Should be changed to:

    MEMBER('ORDERS.CLA') ! where ORDERS.CLA is the PROGRAM Module

3) Convert any other imported "OTHER" procedures by repeating the
   last two steps.

4) Check for comments in the converted source code files which begin
   with #V30. These comments indicate a line which may not have
   converted properly (see CLACNV.DOC).

<<3.009 to 3.1 Conversion>>

<Converting a 3.0 Application to 3.1>

Converting a 3.0 Application to 3.1

The templates in CD31.TPL were designed to provide an easy
upgrade path from Clarion Database Developer 3.00x to
Clarion for DOS 3.1.

One major difference you will find in 3.1 is the universal Browse
procedure. The functionality of the Lookup, Selecty and Validate
procedure templates have been incorporated into the Browse Procedure
template.

If you have modified the 3.009 templates or used a third-party set,
you can import your application's procedures but internal code and
declarations may differ greatly.

<Converting a 3.0 Application>

1) Backup your original application and Dictionary.

   The .APP file format has changed for version 3.1. Once you open
   an application in Clarion for DOS 3.1, the file is updated and
   earlier versions of Clarion for DOS (Clarion Database Developer)
   will not read them.

2) Open the Application in the Application Generator (Choose Open
   for the File Menu or press F3).

3) Change the Template Chain.

         a) Choose Application Properties from the File Menu (or
            press CTRL+O).

         b) Change the Template File to CD31.TPL.

         c) Press the Ok button.

4) Modify the Global Properties.

         a) Choose Global Properties from the File Menu (or press
            CTRL+G).

         b) Press the Compatibility button.

         c) Check the CDD 3.0 box.

         d) If desired, check the Enable Shared Files box. This
            enables multi-user file access.

         e) Mark the appropriate Radio button for the desired action
            to take if a file is not found.

         f) Press the Ok button.

5) Change any procedures which used the Lookup, Select, or Validate
   templates to use the Browse procedure template.

         a) Highlight the procedure in the Procedure Worksheet, then
            choose Change template from the Edit Menu (or press
            CTRL+T).

         b) Press the  button next to the New template field, then
            Select the Browse template.

         c) Press the Ok button.

         d) With the procedure still highlighted in the tree, press
            ENTER.

         e) On the Procedure Properties window, press the
            Compatibility button.

         f) Mark the appropriate Radio button for the procedure
            type.

         g) If you marked Lookup or Validate, the remaining
            fields for the Lookup Field, Input Field Picture,
            Display Key, and Lookup Hot Key have been imported
            from your 3.00x application.

            These all work the same way they did in the 3.0
            template set.

          h) Press the Ok button on the Compatibility Window.

          i) If Range Limits were used, Press the Range Limits
             button.

             Check the Range Limits to ensure that the import was
             sucessful. Template changes may require some minor
             editing. If needed, make any necessary corrections.

          j) Press the Ok buttons on the Range Limits window and and
             Procedure Properties Window.


5) Check any Report Procedures which have Range Limits.

          a) Highlight the Report Procedure, then press ENTER.

          b) Press the Range Limits button.

             Check the Range Limits to ensure that the import was
             sucessful. Template changes may require some minor
             editing. If needed, make any necessary corrections.

          c) Press the Ok buttons on the Range Limits window and
             Procedure Properties Window.


<Using Imported 2.1 Procedures with Imported 3.0 Procedures>

Using Imported 2.1 Procedures with Imported 3.0 Procedures

If you want to use Imported 2.1 Procedures with Imported 3.0
Procedures in the same application, you must delete the ACTION
variable from any procedures using the FORM template.
