Monthly Archives: June 2009

My Success with Clarion 7

When I look at the big picture of my life, I guess I have always been a consistent person, living in the same house since 1985, married to my wife for 22 years this October, and bowling every Friday night in a mixed league. Also important, this November marks my 20 year employment anniversary with the Clarion home office. Sounds boring to some, but all of it seems like a blink of the eye to me.

So why am I mentioning all of this? Clarion 7 is a major upgrade, and now I had a requirement to upgrade one of my favorite real world applications, my Bowling League Manager.

There has been a lot of chatter on the newsgroups regarding problems upgrading applications from C6. I can tell you that “my” producation application is critical to me, because bad bowling statistics can cause discrepancies in standings and individual awards which can cause incorrect league money to be awarded. Many times the bowling center has made mistakes that my audit trail was able to correct, so this program is very important to me.

I had a situation last weekend where my bowling league management application needed a major change for a summer league I am running, and I am very happy to report to you that the conversion of my application from Clarion 6 to Clarion 7, dictionary changes, table conversion, appplication window changes, and finally changes in important hand coded processes was smooth and quick and very gratifying. This blog summarizes what I needed to do and how I did it.

To torture myself this summer, I accepted an opportunity to manage and run a Sport Bowling League called the PBA Experience (the “torture” is the tough sport bowling patterns). As an incentive to recruit new bowlers, the bowling center had given us four games for the price of three.

Now in my 20 plus years of bowling I have always bowled a 3-game series, so it was time to make a change to the league management software.

My first step was to convert the Clarion 6 application and dictionary to Clarion 7. No issues to report here, the conversion was smooth and easy.

11 table dictionary, but nearly all tables related. There are Bowlers and Bowler Master and Bowler Weekly tables, and the same thing for Teams. Add the Schedule and Weeks and Divisions and that’s the core of the database.

Step 1: Add a Game 4 to the Bowler and Team weekly tables. I used the Dictionary Copy and Paste, copied Game 3, and then renamed the result to Game 4.

dctstep1

Step 2: Convert the existing tables to their new format. I took the easy route and let the dictionary auto-convert my bowler and team weekly tables, creating a backup of my test data. I was very happy with the results:

dctstep2b

dctstep2c

That’s all I needed to do in the dictionary. The next stop was the Application Editor. Again, it’s a typical application with roughly 50 procedures. Lots of reports and 3 key processes.

Step 3: In the Application Generator, I needed to add the new Game 4 fields to two forms, the bowlers and teams weekly updates:

appdesigner1

I quickly got the hang of the alignment toolbar, and decide to use the Populate option in the Menu instead of the Data/Tables Pad. Again, just a creature of habit!

..and finally, my process logic in several embed points now needed to account for the additional game:

appdesignerembeds

I really like the new embed editor, with code completion, quick class browser and all of the other features. In most cases I simply needed to add the Game 4 logic where needed. A lot of it was copy and paste. I won’t bore you with all of the places I changed. I will say that in this case the Data/Tables Pad came in VERY handy, as I was able to easily drag and drop the field names that I needed into the embeds.

I wanted to test this quickly since the league was starting in a few days. Looking back, I will add conditional logic to the league configuration file to set it for 3 or 4 games, and then wrap my logic around that condition.

The rest of the story was non-eventful…Generate, Build, and Run. The program works perfectly, and in the next couple of days I will add the Game 4 column to a few end of season reports.

Here are the procedures that I modified, all in total about 1 hour’s work.

summary

In summary, working with Clarion 7 was extremely satifying. I know that there will be other projects that will be more challenging in the months to come.  As the project progresses I know there is more work ahead, but I am looking forward to it.

Easing into Clarion 7 – Part 9 of 9 – Application Options

In Clarion 6, your options for different sections of the IDE are located in an IDE Setup Menu:

c6setup

In Clarion 7, all of the important Application, Dictionary and other important IDE options are all accessible from the IDE Tools Menu:

toolsmenu1 

There are three new Application Options of note:

On the Application tab:

Check the Auto-Make Applications before compile box to trigger the Application Generator to generate source prior to the Build action if needed.

Check the Auto start designer on pressing the Window or Report button box to auto-load the target Designer when pressing the Window or Report button located on the Procedure Properties window. You can still view the Window or Report text by pressing the tabs in the Procedure Properties window.

On the Generation tab:

Check the Use long file names for generated files to generate application source files using the full application name followed by a three digit module number.  If you would like to use the older 8.2 naming format, clear this box.

blueline

The Dictionary Editor also has some great new options to help you fine tune your development environment.

Set the Initial Version Text to display the text to display when the version is set. When you first create a dictionary it has an initial version with a name equal to what you set in that field.

During the lifetime of the dictionary you can create new versions.
Each version is a marker that is used in the Audit details of an object. If you go to the Audit tab of any object in the dictionary you will see a Version against the Created and Modified details. This indicates which version of the dictionary the object was created in and in with version it was last changed.

The Initial Freeze State defines the initial “Freeze State” of the dictionary components as they are first imported.

After a conversion program is generated the Load Conversion Project option sets how you can load the project. You can set this to always load the project, never load the project or ask each time a conversion program is generated. The default is to ask.

When Enforce Clarion# name restrictions is checked, the dictionary editor will not allow you to create labels that are not valid in Clarion#. For example. AS is an illegal label, but legal in Clarion for Windows. If you do not want to worry about Clarion# restrictions you can uncheck this box.

If Clarion# restrictions are enabled and you load a dictionary into the editor that has a label that violates the Clarion# naming restrictions the editor will automatically rename the object to ObjectType_OldLabel, where ObjectType is a Table, Alias, Global, Pool, Key or Column. If the object is a Key or a Column with no external name, the external name is set to the old label.

For example, “AS STRING(10)” will be converted to:

“Column_AS STRING(10),NAME(‘AS’)

Any such change will appear in the Dictionary Changes pad.

 

Easing into Clarion 7 – Part 8 of 9 – Where’s my Property Editor?

In the Clarion 6 Window and Report Formatters, there is a special Property Editor (F12 Key) utility where properties of multiple controls could be viewed and modified:

c6propeditor 

In Clarion 7, the Property Editor is no longer needed, and has been replaced by the new Properties Pad:

 propertypad

Open this pad in the IDE at any time by pressing the F4 Key. The properties that you will view are based on what IDE element is currently selected. Usually this is a WINDOW, REPORT, or a control, but it could also be one of many project elements.

The new Property Pad is easier to use, displays more information in one view, and is more flexible. You can sort alphabetically or by category. To update properties common to multiple controls, simply lasso or select the target controls in the Designer and change all properties as needed.

proppad2 

 

Many property values are comprised of a finite set of choices (i.e., colors), or sometimes just a “TRUE” or “FALSE” value. Use your mouse or cursor keys to navigate to a target property value, and then click or press the space bar to cycle through valid choices.

 

Easing into Clarion 7 – Part 7 of 9 – Lazy Loaded Applications

With the ability to maintain multiple applications within a single solution, there are common shared elements of the applications that can be pre-processed prior to editing and source generation. This pre-processing of a
selected application is called lazy loading.

In the Clarion 7 IDE, a fully opened application is one that is loaded in the Application Editor.  However, applications can also be “lazy loaded”, meaning that the application may not be loaded in the Application Editor yet,  but the application template registry and any parsing of source libraries required by the templates has been performed. This allows for faster loading of applications into the Application Editor, and allows the project system to more efficiently build applications that are not currently opened in the Application Editor.

“Lazy opened” applications in the Applications Pad are marked with a special icon (highlighted in yellow below):

 

apppad

 

 

Applications not opened or “lazy loaded” are marked with a different icon (shown above not highlighted).

The Applications Pad is a powerful tool in the Clarion 7 IDE. For solutions with multiple applications, you can easily select and generate the application that you need.

If you select an application to generate, and the application is not already opened, the Generate action will “lazy load” the application as described above.

 

Easing into Clarion 7 – Part 6 of 9 – Maintaining a Multi-Application Development Solution

One of the fantastic new features of the Clarion 7 IDE is its ability to manage multiple applications in a single solution. I mentioned this in my very first blog in this series. (See Part One in this series if you haven’t already done so). 

Every development project is contained within a solution. Of course, you can have a single project associated with a single solution, and for most of the time, this will be the case.

However, a solution can also contain multiple projects. As always in Clarion, projects can be hand coded (source only) or, they can be associated with an application file, where templates and embeds are responsible for generating the project source.

Since multiple projects can be contained in a single solution, it is also true that multiple applications can also be contained in a single solution.

And yes, for your projects where multiple applications were needed (some produced DLLs and one produced the executable), they can now be managed and maintained in a single solution, and you may edit them all at the same time!

For example:

 multiappdisplay

How cool is that?

And this brings me to the main point of this particular blog. An application is always a part of a solution, but since solutions can contain multiple applications, you must be aware that closing an application does not automatically close a solution.

So, the Save and Close button shown here:

saveandcloseapp1

…will only close the active application (e.g., “Allfiles.APP”)

To close an entire solution, first close each application opened for editing, and then use the Close Solution button in the main IDE toolbar (shown here).

closesolution 

As shown above, you can also use the CTRL + SHIFT + F4 hot key combination (or use the File > Close > Solution IDE Menu item).

And rest easy fellow developer, you can only have one solution active at any time in the IDE, but with the ability to launch multiple sessions of the C7 IDE, well, that’s a topic for another time! <g> 

Easing into Clarion 7 – Part 5 of 9 – Meet the Data/Tables Pad

Experienced users of the Clarion 6 Application Generator may notice a change in their Clarion 7 Procedure Properties window.

In Clarion 6, there were buttons in the Properties dialog that would “drill down” and identify key areas of any procedure:

browsestudentsc6

In Clarion 7, the buttons are essentially replaced by tab controls in the dialog as shown here:

 browsestudentsc7

But what has happened to the Data and Tables buttons that we saw in Clarion 6?

The answer is that they have been consolidated into a new and easy-to-use IDE pad named the Data/Tables Pad (DTP).

dtp1 
 

As you can see, table and application data are displayed and maintained from a single source pad. Press the F12 key at any time to open (or bring focus to) the DTP in the IDE. Buttons at the top of each list in the DTP allow
you to add, modify, or remove table and data elements where
appropriate.

So stated another way, this is the pad where all dictionary information, and global, module and local data for the application is displayed. This is also
the pad where new application data can be added if needed. The pad
is also a handy tool when the Window and Report Designers are active.

In the Window and Report Designers, drag a field (column) from the DTP to the window or report area for easy and quick population. The Populate Columns and Populate Multiple Columns functions that you used in earlier version are also available in Clarion 7 if you would prefer to use them instead. Access these utilities from the Window or Report Designer menus:

 dtp2

Just remember that anything data related (Global, Local, Dictionary Based, etc.) is always available from the Data/Tables Pad!

Easing into Clarion 7 – Part 4 of 9 – Windows, Reports, Toolbars, and Menus

First, the terms Window Formatter and Report Formatter of prior Clarion versions have been replaced with a simple and common term: Structure Designer.

In source code, access to the Structure Designer is available at any time by pressing the CTRL + D hot key. This is similar to the CTRL + F key that you used in earlier Clarion versions. You can also use the IDE Menu to access the Designer (Edit > Structure Designer).  

Of course, in the Application Generator, access to your Window or Report is still easily available from the procedure’s pop up menu, the Window or Report button, or through a new tabbed interface in the Procedure Properties dialog:

designers 

designerstab

 

The tabbed interface give you access to the generated window and report structures, where you can edit them directly as source if needed.

In upcoming topics we will look at the new Structure Designer in more detail. Let’s take a quick look at the Menu Editor.

The majority of applications that you create in Clarion start with some kind of menu system that allows you to launch other procedures. The most popular way to do this in MDI applications is with a Frame procedure.

In Clarion 6, a Frame procedure in the Window Formatter relied on the Menu Editor, and also on the Dynamic Toolbar and Menu IDE menu selections as shown here:

c6menutoolbars 

In the Clarion 7 Structure Designer, menus are added to windows through the Structure Designer’s Toolbox Pad:

 toolbox

From the IDE Menu, you can open the Toolbox at any time by selecting View > Toolbox. Of course, the Clarion Window Controls section with all of the controls shown above is only visible when the Designer is active.

To populate any control, use the mouse and drag a control from the Toolbox to the target location in the Window or Report area.

These are native controls and are not bound to any data or template support. We will look at those special controls in the next blog topic.

Populating a MENUBAR control enables access to the Menu Editor. In Clarion 7, the enhanced Menu Editor is available via the Structure Designer’s Properties Pad. You can also right-click on the MENUBAR and select the Menu Editor from the pop up menu.

 Both are shown below:

 editmenu

The Menu Editor has a very similar look and feel as it counterparts in earlier Clarion Versions, and is very intuitive in its use:

 menueditor

Note the toolbar highlighted above. Here, you can add new MENUs, Separators, ITEM’s, move them up or down, and access Actions and Embeds where needed.

To the right is the property control dialog, where every characteristic in the selected menu element can be accessed and modified. Examples of this are menu icons, colors, text, fonts and much more.

So that’s the basics in editing your application’s visual elements in Clarion 7. 

More to come!

 

 

Easing into Clarion 7 – Part 3 of 9 – New Application

To create a new application in Clarion 7, there are three options.

1. Use the hot key CTRL + SHIFT + N, and select Application as shown here:

newapp 
Enter your application Name, select the Location and folder options, and press the Create button. This will open the Application Properties window.

appprops 

This is the same interface that you were familiar with in Clarion 6 and prior versions. From here, you can proceed to open the Application Wizard, or bypass it and open the Application Editor.

 Alternatively:

2. From the Start Page, you can press the New Solution button from the appropriate category. This will open the same New Project dialog shown above.

OR

3. Use the IDE Menu option and repeat the same steps as outlined in (1).

 

 

 

 

 

 

 

Easing into Clarion 7 – Part 2 of 9 – New Dictionaries

To create a new dictionary in Clarion 7, there are three options:

1.  Use the hot key CTRL + N, and select Clarion Data Dictionary as shown here:

newdct

Click on Data Dictionary (or TAB and select via the Space bar), and click on Create (or press the Enter key). This will create a new DCT with a default name of Empty1.DCT.

As you save your changes in the dictionary you will be prompted to
rename it if needed.

2. Use the Start Page to create a new dictionary. Select the Dictionaries link and press the New Dictionary button. Using this technique, you will be asked to name your dictionary prior to entering the Dictionary Editor.

3.  Use the IDE New File Menu option and repeat the same steps as outlined in (1)

 

Easing into Clarion 7 – Part 1 of 9 – New Components

Now that the blogs are finally back, by popular demand I am reposting the “Easing into Clarion 7” series.

Back in Clarion 6, a NEW IDE item was limited to only 5 items:

 newc6

In Clarion 7, there are new Files (CTRL + N) and a new Solution, Project, or Application (CTRL + SHIFT + N)

What is a Solution?

To simplify it to basic terms, a solution is any IDE element whose end result (output) is a library or an executable. With that in mind, projects (*.cwproj) and applications (*.APP) are both considered parts of any solution.
All projects and template based applications must be contained within a solution.

The default file extension for solutions is *.SLN.

Project files in Clarion 7 use a *.cwproj extension, and are created for you automatically by the IDE. A new project window allows you to specify a custom hand -coded project or project application:

 newproject
 

This is an important and vital concept that is new in Clarion 7. Both applications and hand-coded source files use a project file. This project file contains all of the information that the IDE needs to build the hand coded project or application into a target output.

 The solution file can hold one or many projects, and this is where the new power of Clarion 7 begins to surface. One solution can be used to maintain a large multi-DLL application project, or it can be a simple as holding a single
hand-code project or application. Your choice!

 There are many ways to open each type of “New” dialog.

1. Using the Hot Keys (as documented above)

2. Opening new Files and Solutions (Projects and Applications) directly from the IDE Start Page:

newc72

Note that in the Start Page, new files are divided into 4 categories (Dictionaries, Diagrams, Tables, and Source Files)

Dictionaries are the same dictionaries that are used with the template based applications.

Diagrams call the new Dictionary Diagrammer, which provides a graphical tool for your dictionaries.

Tables call the new Database Browser, which allow you to browse files of all supported database formats.

Source Files open clarion language source files, which defaults to a CLW extension.

You can create all of these files in the Start Page, and also open existing ones!

3.  Launching a new file or solution from the IDE Menu.

 newsolution1

Of course, you can also open new files directly from the IDE menu. In the New File dialog, you can specify the file type to direct you to the appropriate area of the IDE.

In future articles, we will explore multi-project solutions in more detail.

 

Personal Development Resources