1

For several months I have not been able to do much with the new Clarion 7 IDE because of crashes that would happen pretty frequently or about every 10 minutes. Needless to say that is not productive in any way and in fact I have stayed away from it, hoping that Softvelocity would get the IDE more stable. It has been a frustrating experience as I have tried many times to make the IDE work for me, with the only reliable outcome being consistent, yet random and unpredictable crashes or the IDE has simply disappeared without any warning.

Last week I was contacted by a customer who was having some odd things happening with a Legacy (clarion template chain) application in Clarion 7.2 that used our Previewer and asked if I had experienced any issues. I have to admit that I don't do much product testing with Legacy anymore and haven't tested any Legacy apps in Clarion 7. So I decided this would be a good time to create a small legacy app in Clarion 7 and see how it worked. To cut a long story short, an hour and 5 crashes later I had a Legacy app that compiled and worked fine and reported that to my client. But the experience was anything but good. 5 crashes and a feeling that the IDE was very fragile. Admittedly I was running it on an older computer with XP and not much power in it, but still. I also have Clarion 7 on my Vista64 quad core computer with 8GB of RAM and I had experienced exactly the same issues on it as on my XP.

A friend of mine, John Hickey of GoPositive Software and ClarionLive fame contacted me this morning and offered to do a private webinar with me to see if he could help get over those crashes as he has been using Clarion 7 for a while. Arnold Young also chimed in as well so we could all compare settings and see what was going on. We spent an hour talking about the different settings and John shared with us what changes he makes that seem to make the environment much more stable than the default settings that Clarion 7 comes with, which I have been using with not so good results.

After we were done, I repeated my Legacy app creation and while there is a bug somewhere in the Legacy Wizard and/or the TXA import other than that problem (which leads to a crash) the rest went smoothly. No other changes were made, i.e. I did the test on my old XP machine, with the same dictionary, same Clarion 7.2 build (7283) and same steps. So I'm very happy to report that those changes do seem to have cut the random crashes down completely. I messed with the app a bit for about half an hour and C7 was just humming along nicely and no problems in sight. Below I'm detailing the settings that I changed based on John's advice and he graciously allowed me to post this information on my blog. I really hope this may help others who have been having those random, yet predictable and very frustrating crashes, to become productive with the new IDE!

To start, select "Tools | Options" from the main menu. Select the Clarion entry in the list on the left and it will expand to show several nodes of Clarion specific settings and select the "Clarion | Clarion for Windows | General" node as shown below.

Clarion - General

By default the second radio button is checked, "Parse all hand coded projects in the solution and only applications opened for editing" and the "Use lightweight parsing mode" is also checked. The change that we made here was to select the "Disable project parsing" This affects code completion, but this apparently is one of the major cause of crashes.

Next navigate to the "Text Editor | Clarion specific options | Code Completion"

Code Completion

The change we made here was to uncheck the "Enable Code Completion" turning code completion completely off. The Code completion adds quite a bit of time parsing the projects and sources and this seems to be contributing to the instability of the IDE.

Since we are in the Options window, there are two more settings that will improve your experience, while not contributing to fixing the crashes, but since we are already in this window we might as well look at them!

Navigate to the "WINDOW Structure Designer | General" node and in the "Designer Area Options" check the "Show Property Toolbar".

Window Structure Designer

Now repeat in the "REPORT Structure Designer | General node:

Report Structure Designer

When you open the Window designer or the Report designer you will now see the familiar property toolbar from the older IDE where you have quick access to the text, use variable and font settings of the selected control, see below.

Command Toolbar

The final tip on the performance and crashes is found in the application options. So close the Options window and use "Tools | Application Options" from the Clarion 7 main menu. Note that if an application is open, this menu item is disabled.

This will bring up the "Application Options" window.

Application Options

The changes we made there were to turn the Auto-Save OFF by setting the "Auto-save limit (MB):" to zero. This may or may not contribute to the crashes. John has this set to zero while Arnold was using the default setting of 16MB. I have set it to zero to start with.

While you are in there, if you haven't done so already, you might want to consider turning off the "Require a dictionary" checkbox at the top. It is not of much use but can cause problems if you open application that do not have any dictionary as you will not be allowed to save them!

That's it! I will be using these settings to start with but what little I have done today indicates that these changes have added considerably to the stability of the IDE. If you have any further tips or suggestions to improve the stability and user experience of Clarion 7 then please do not hesitate to send me an email or comment on this blog.

PS: If the IDE is indeed stable with those changes I will start to add them back one at a time until I hopefully can put my finger on what and where the instability is coming from and that might help Softvelocity in their quest to fix this.
Arnor Baldvinsson

Last Monday, Ed Robinson CEO of Aptimize (http://www.aptimize.com) talked at our .NET user group meeting in Redmond, about optimizing web sites. He pointed out one of the tools they use, http://www.webpagetest.org It is very interesting to run this on your site to see how it will perform.

It lists every item that is downloaded, every file, how long it takes to download, how long the server response is etc. It gives you a really good idea how long a website takes to load from various parts of the world as they route the signal through various servers, for example in the United States, Britain, the Netherlands, New Zealand etc. Four things that Ed suggested to make pages faster to load:

  1. Minify css and javascript files and anything else that can be minified. This can drastically reduce the size of those files as it cuts out all whitespace and with js files it also reduces the length of parameters and variable names.
  2. Use sprites for images. This means fewer downloads, fewer roundtrip requests.
  3. Consolidate files that are sent to the browser, such as css and javascript. This also reduces the number of requests to the server.
  4. Compress anything that can be compressed. Here is an article about compression using php or .htaccess Here is an article on how to set compression on the Apache webserver.

I found an excellent writeup of website optimization that explains each of those items in more detail. Ed's talk was only 15 minutes, but by itself, was worth the 7 hour total time for the trip (including waiting an hour for the ferry after missing the last one by 2 minutes;)

We are in the process of slightly redesigning the Icetips website and the plan is to have it up by the end of June 2010 and we will definitely be looking into how to optimize it as much as we can. We all like fast websites and none of us like waiting for a web page to load! It will be an interesting experiment and I hope you will see a much quicker website by the time we are done with it:)

Arnor Baldvinsson

Today we have discovered a problem in the latest Clarion 7.1 build 6849. This problem affects most of our products and will cause a GPF in the program at runtime. What I found out was that the #PDEFINE template statement, which we have used for years to add defines to the project, doesn't fire in this Clarion 7.1 build so classes that depend on their own defines in the MODULE and DLL attributes are not compiled correctly and will cause a GPF when the classes are instantiated.

I have reported this to SoftVelocity's Problem Tracker and I really hope that this will be fixed in the next build.

If you converted projects from Clarion 6 to 7.1 with our products in them, you should be just fine. This only affects templates that you have added to applications in this latest build of 7.1 and possible some of the latest builds as I'm not 100% certain when this stopped working.

I am also looking into an obscure problem in the SQL browse template that only shows up in 7.1, when the GreenBar is being used and only when a new column has been added. After then app has been closed and re-opened the problem goes away and also if the actions for the SQL browse have been entered after a new column has been added. It could be something in our templates or it could be something that is related to the #PDEFINE issue if some statements are not executing correctly.

Arnor Baldvinsson

My client reported a problem when attempting to run our project that was a bit baffling:

"The procedure entry point _18ProtectedHashTable__ct__@FiP15CriticalSection could not be located in the dynamic link library c60runx.dll"

Since all that we are sending back and forth are the applications and no binary files there was no way that we were mixing any binaries up, besides we are using the exact same builds of Clarion 6.3 - 9059 so this shouldn't be a problem at all.

After asking around I found out that the reason for this is that Clarion 7 includes a Clarion 6 compiled version of Topscan, which is not compiled local so they have to distribute the Clarion 6 versions of the DLLs with Clarion 7. In our case, the Clarion 7 Bin path has been added to the PATH variable, either manually or by an installer (we do not know which one if it has been done by an installer). Not just that, it has been added in front of the Clarion6\bin folder in the path causing the Clarion 6 application to pick up the C60RUNX.DLL from the Clarion 7\Bin folder rather than the Clarion6\Bin folder.

After some experimenting, I found that at least for Clarion 6.3 build 9059 I could have both BIN folders in the PATH as long as the Clarion 7 one was after the Clarion 6 one. The Clarion 6 apps still run without problems and the Clarion 7 Topscan also runs correctly and without problems as far as I can tell.

So, IF you want to put the Clarion 7 BIN folder into the path statement, make sure that you do that after the Clarion 6 BIN folder. Normally you do not need to do this, but if you don't want to copy DLLs to the application folder using the PATH do access the binary files is one way to do it.

Update: It appears that if you are using Clarion 6.3 build 9056 it does not conflict with the C60RUNX.DLL file in Clarion 7.

Arnor Baldvinsson

I was doing some php research yesterday and stumbled on this online php book that had some very good information and examples that I could put to use right away. Check it out at http://www.tuxradar.com/practicalphp It's all online in html format, so there is no PDF etc. but it is easy to navigate with links to previous and next chapter as well as a "Jump to" drop down and a link to the table of contents.

The book has been updated for php 5.2 so it is kept fairly current, which is always a plus with online content!

So, if you are looking for good, free, text on php stuff, check this book out - it doesn't cost you anything:)

Arnor Baldvinsson

Currently there is no direct way to set a fixed filename for any of the output targets inside the Icetips Previewer, but you can easily do this on the report itself, rather than passing the name to the previewer and do it there. In fact this would probably be the preferred method since the report probably should determine the name and location of the resulting filename.

You need to put code into a single embed where you set the filename:

Embed Tree for setting target filename

All the code that you need is just a call to the SELF.SetFileName() method. Please note that each output target has it's own Setup method so if you have multiple output target templates active you will need to do this for all of them. You can pass the filename as a string, variable or an empty string if you want it to open the file dialog in the Previewer when you print to PDF.

Embed for setting target filename

In this case you can use:

SELF.SetFileName('')  

This triggers the FileDialog to open in Previewer when you click on the PDF button.

SELF.SetFileName('myfile.pdf')

This writes the PDF file as "myfile.pdf" to the current folder.

SELF.SetFileName('C:\temp\myfile.pdf')

This writes the PDF file to specific folder, which is probably not what you want to do!

SELF.SetFileName(LOC:PDFFileName)

In this case a variable is used. You can prime the variable anywhere before the PDFReporter.SetUp method is called, or you can do it right before the SELF.SetFileName. Note that the PDFREporter.Setup method is not actually called until the report is in the Previewer so if you use a Global, Threaded variable, you can set this in the Previewer. Since the previewer and the report will always be on the same thread, you can just set this variable to be threaded and then there are not threading issues to deal with.

Here is an example of how this can be implemented. On the report I have changed the code to:

SELF.SetFileName(Glo:PDFFileName)

The global variable is a CString(2049) global variable with the "THREAD" attribute. To do that simply check the "THREAD" checkbox on the "Attributes" tab when you create the global variable - doesn't make a difference if you do it in the Global Data or in the Dictionary.

In the Previewer, all that is needed now is to set the global variable. Normally I would think that you would want to set the filename on the report, but this gives you an idea how to do it on the Previewer also. I have added an instance of our ITShellClass from the Icetips Utilities to the previewer procedure - in the "Local Data" embed I added:

ITS  ITShellClass

Now in the "Local Objects | Icetips Previewer | Clarion 6 Save Buttons | Before Save Dialog"

Embed Tree for setting target filename

I have added this code:

  If GQ.GName = 'PDF'
    Glo:PDFFileName = ITS.GetSpecialFolder(IT_CSIDL_PERSONAL) &|
                      '\MyPDF.pdf'  
    !! Glo:PDFFileName must be be used in the report's 
    !! PDFREporter.Setup.

    If Not FileDialog('Select PDF to save',|
          Glo:PDFFileName,|
          '*.pdf|*.pdf',|
          FILE:SAVE+FILE:KEEPDIR+FILE:LONGNAME+FILE:ADDEXTENSION)
      Message('No PDF File selected, aborting PDF save',|
              'PDF Saving aborted',ICON:Hand)
      Exit
    End
  End

Note the "GQ.GName = 'PDF'". This allows you to just do the PDF if you want the default filename handling for other options. The GQ contains all the target names, such as "PDF", "HTML" etc. At the top of the routine that handles the targets in the Previewer, the correct item is selected from the GQ queue so throughout the routine you can use GQ.GName to determine what is the active target being printed to.

If you find new ways to use this, I would certainly appreciate if you would be kind enough to add a comment to this article so I and others can benefit:)

Arnor Baldvinsson

Roberto Artigas has sent us the latest version of his popular DCT2SQL templates and I have made them available for download on our download page.

According to Robert this new version is compatible with Clarion 7.1. He has fixed some minor issues caused by incorrect placement of #BOXED/#ENDBOXED pairs. And the templates are backward compatible with Clarion 6.3 so you can now use those popular templates on both IDEs:)

Arnor Baldvinsson

When running Clarion 7 on Vista or Windows 7, some people have run into an issue where they cannot open .hlp files from the IDE. This is not a problem with Clarion 7 as such, but that the templage language still only supports the .hlp file format and Vista, Windows Server 2008 and Windows 7 do not include the WinHlp32.exe program to open the .hlp files.

Fortunately Microsoft has made them available for download for the past two years or so. Go to http://support.microsoft.com/?kbid=917607 and download the appropriate program for:

Vista
Windows 7
Windows Server 2008
Windows Server 2008 R2

Note that vendors cannot re-distribute WinHlp32.exe with their products so Softvelocity has to rely on developers downloading and installing the program directly from Microsoft.

Also note that in order to install WinHlp32.exe you must be logged in as administrator.

Arnor Baldvinsson

I had the need to create an install with Setup Builder 7 that would be time limited so that it would not run after a certain date. Obviously this is no foolprof method since it can easily be bypassed by changing the date in the computer, but for what I wanted it was perfect!

Set Variable %IT_TODAY% to FUNCTION:Get System Info
  (Current Date) -- Format "12"
If %IT_TODAY% Greater Than "20100228" Then
   Display Message Box "This time limited Beta build 
     install expired on Fe..." -- 
     "Time limited Beta install has expired"
   Exit Installation(99)
Else
   Display Message Box "Note that this is a time limited 
    Beta build instal..." -- 
    "Time limited Beta install"
End

Note that the lines wrap and in the actual script this is only 7 lines, which start out bold in the box above.

The first line get's the current date from the computer where the install is running in a "YYYYMMDD" format. The IF statement compares the value with "20100228" - February 28, 2010, and if the current date is greater, then it displays an error message and exits the install. If it is equal or less, then it displays a warning message about this being a time limited install and continues.

Arnor Baldvinsson

If Clarion 7.1 crashes on startup with something like:

Clarion Version : 7.1.0.6545
..NET Version         : 2.0.50727.3603
OS Version           : Microsoft Windows NT 5.1.2600 Service Pack 3
Current culture      : English (United States) (en-US)
Working Set Memory   : 38052kb
GC Heap Memory       : 1989kb

Unhandled exception terminated Clarion

Then the chances are pretty good that you do not have the Visual C++ Runtime Library update that is required. To fix this download and install this file from Microsoft: Visual C++ Runtime Library

This installs the VC2005 RTL and Clarion 7.1 will now load properly.

Arnor Baldvinsson