Migrate Clarion 5 to Clarion 9

I would like to know how I can proceed in this case. We have legacy software, but we are already reaching the limit of Clarion 5, as it uses TPS, and we would like to use Clarion 9. Any tips? It is not possible to do this automatically.

I’m not sure I understand “we are already reaching the limit of Clarion 5, as it uses TPS”
C5 can use SQL, C9 can use TPS files
So what’s the reason for moving?

But to answer your question, it’s a long and tedious process because if you have any threads in your app at all then you’re also changing threading model, with everything that entails.

Don’t know if v9 is good enough to adopt it…
Here, we migrated from v6.3 ABC to v10 and then to v11.1…

As Paul said, it really depends on what kind of code you have that will be impacted by the threading change introduced in C6.
You need too review your code for non-threaded global variable usage. Variables that are NOT write-only, read many need to be reviewed and made thread safe.
Global Queues need to made thread safe.
If you use SETTARGET( ) to switch thread context so you can manipulate a window on another thread, this code needs to be reworked.
Those are the big ones to look out for, from what I can remember.

Compared to other version upgrades, the move from Clarion 5x to 6 and beyond can be a huge amount of work, especially if you have any 3rd party templates that are no longer sold or supported.

If the ONLY thing driving your decision to upgrade is the limitations of the TPS driver, it might be good to consider putting your effort toward an SQL solution. Upgrading Clarion will not solve your TPS problems.

This will give you time to start updating and testing your C5 code to be compatible with later versions of Clarion so that it won’t be so difficult to convert when you decide to upgrade later.

Backup Everything First.

An option at this stage is to C9 IDE> Build>Set Clarion Version to C5, to use the C5 runtime, if it detects C5. See C9 help page “Multiple Clarion Version Support” for more details.

The IDE tries to detect all Installed Clarion Versions at first run using data from the Win.ini and Regsitry, but you can also manually add Clarion versions versions from the main menu Tools > Options > Clarion > Clarion for Windows > Options

Copy everything over to new folders, and install/copy the templates across, resolving any template problems if they occur.

Try to load the C5 apps in C9 and try to resolve any problems cited.

IF you ever need to copy a C7+ TXA back to C6 (havent tried earlier versions), just remove the local variables declared in each AppGen procedure and the TXA should then backport without a problem.

If you use string values in global cstring initial values eg “MyInitialValue” but only set the cstring to 2, an AppGen generation change I’ve noticed in C11 which doesnt throw any warning, is the cstring will be generated as Cstring(‘M’) and not Cstring(‘MyInitialValue’), so watch out for that as it might occur elsewhere in the appgen like local vars and in the dct.

Word of warning, the default number of procedures per module, is 10, so to adjust it back to 1 procedure per module, C9>AppGen app loaded> Application> Redistribute Procedures, change the popup window from 10 to 1.

Once dct & apps are converted and loading in C9, try to generate and compile.

If you set the Clarion Version to C5 then…
As mentioned elsewhere, the C5 threading model is the Cooperative Threading Model, so you will need to add the Global Extension tab, Insert button, GlobalCooperativeThreading template which ships with Clarion to each app file.

If you did not set the Clarion Version to C5 then…
The default Threading Model in C9 will be the Premptive Threading model, which means you’ll need to review your global variables and Q’s to make them thread safe, as other’s have mentioned here.

See “Preemptive and Cooperative Thread Models” in C9 help for more info on the threading models.

I’d also suggest going to C11.1 rather than go from an obsolete version to another obsolete version.

Depending on your code and templates, the conversion could be as simple as open the apps in the new version and make. As other have said however, there may be a few caveats hidden in the successful conversion.

If you need to convert to SQL to overcome TPS limits, I’d really really suggest upgrade first and make sure thats ok, then convert to SQL later. The SQL conversion can be done piecemeal, converting a table at a time.

1 Like

As SeanH has suggested move to C11.1. That would be your first step.

You could use Capesoft’s Multi Proj product CapeSoft Multi-Proj

To allow you to easily create an SQL version of your app (you will still need to move from C5)

I’ve used it in the past and it’s been a fantastic tool that’s saved me a lot of heart ache.

I have made that conversion 5 to 9.1. Clarion 9 has some UI issues that were fixed. You could look in the Problem Tracker to find them and possible fixes.

One I recall is if a BUTTON is the first control on window, I think it is sometimes hidden. I think had workaround template code that checked for a Button first then in Event Window Open did something. Also if a CHECK or RADIO had SKIP the &Alt key didn’t work so added PROP:Key with that key to make Alt+ tick/untick.

I would suggest move to 10.0 minimum. I like to use 11.0.13505.


You said “legacy software” are you using Legacy Templates or ABC?

In Legacy Templates there was a significant template change from 5 to 6 that moved the

#EMBED(%AfterWindowOpening,'After Opening the Window')

from Below resizing to Above resizing. This change in code order can sometimes cause problems, so all code in that embed should be reviewed.

This change was made so Legacy matched ABC. You’ll find this comparing Standard.TPW inside #GROUP(%StandardWindowOpening).

  C5 Standard.TPW ============ excerpt 5 ===================
#GROUP(%StandardWindowOpening)
#EMBED(%BeforeWindowOpening,'Before Opening the Window')
OPEN(%Window)
WindowOpened=True

#EMBED(%BeforeWindowIniResize,'Before Resizing Window From INI file')
#EMBED(%AfterWindowIniResize,'After Resizing Window From INI file'),HIDE
#EMBED(%AfterWindowOpening,'After Opening the Window')  <=== Note Below ====
  C11.0 Standard.TPW  ============ excerpt 11 ===================
#GROUP(%StandardWindowOpening)
#EMBED(%BeforeWindowOpening,'Before Opening the Window')
OPEN(%Window)
WindowOpened=True

#EMBED(%AfterWindowOpening,'After Opening the Window') <=== Note Above ====
#EMBED(%BeforeWindowIniResize,'Before Resizing Window From INI file')
#EMBED(%AfterWindowIniResize,'After Resizing Window From INI file'),HIDE

I’ve been consulting with a team that converted a very large (420+ apps) heavily customized templates with lots of in-house classes and heavy use of theading from C5 to C11.

There is no point going to C9, but frankly an update from C9 to C11 could be done later if you like, that would be trivial.

If your C5 templates are customized then obviously the first task is to merge those customizations with the current template set. That’ll take a couple weeks, but is worth doing well.

Are you using global, unthreaded, queues? Those need to be made safe - we used MaxQueue for that and its worked very well.

The C5 app needs to be checked to understand what accessory code was in play. Ours had lots of Power Browse so i made a c11 version of that (a c6 verson exists so that was straightforward. )

The main system was severly multi-threaded with sometimes 20 threads all doing things. Inter-thread communication had to be refactored to use events.

The c11 version is now working well, and looks better and is a lot more stable than the C5 version. More importantly it can now be maintained with current code, and make use of other available commercial products. Its a massive leap forward (25 years) but well worth the effort.

It was, of course, a lot of work because all the work that shoild have been done 25 years ago wasnt done. And because they were happy to change the shipping templates (which they’d been doing since at least Clarion 2.)

Id say the bulk of the work was effectively the c5.5 to c6 jump. Converting c6 to c11 is a very simple process. That takes days or weeks depending on the size. But c5.5 to c6 takes longer, especially if you use a lot of globals. Fortunately MaxQueue was available, otherwise dealing with the queues would have been a lot more time.

But the result has been well worth the effort. The programmers are happy (obviously), management is very happy (the program looks better and is more stable. )

1 Like