Category Archives: Clarion.Net


The options to provide access to your Clarion program on non-PC devices now range from using RDP products, creating pure Web apps, or with @Thin or ClarioNet. And we’re going to be offering some more options for Clarion9 and Clarion.Net.


Today I’m writing about a new product (internally named H5 Builder). H5 is a blend of the best features of Internet Connect (IC) and Web Builder (WB), joined with the jQuery family and HTML5/CSS. Both IC and WB were products ahead of their time. As an example IC was using an async data packet methodology to refresh client side pages before technologies like Ajax were on the drawing board. With the addition of a global template both IC and WB allowed Clarion apps to run over the internet without (hardly) any work at all from the developer.  Drop in the template, remake the app, and deploy. However, they both had the same limitations; difficult (or impossible) to work with the web UI presentation to fit within existing web sites, and they required IIS experience.  They also weren’t positioned properly.  Developers who tried to use either product to create a “web site”, or create a web app that needed to scale to 100’s-1000’s of simultaneous users found neither could meet their requirements.

Flash forward to today and H5.  The intended use for H5 is not to create a “web site”, nor to create a highly scalable web app.  Instead H5 is positioned to make it dirt simple to make your app available as a private web app for a given business/enterprise via a web browser, whether that’s on a PC or on a smartphone/tablet. And it’s built upon today’s standards for the web; HTML5, CSS3, and JavaScript. These standards are open, secure, and efficient, and they allow developers and web designers to create apps that look modern, can fit into existing sites (sharing CSS styles) and can run on modern devices like phones and tablets.

H5 apps use the jQuery library, either jQuery UI or jQuery Mobile (UI), and JSON for updating client side data without a full page refresh.  They run under the AppBroker SE, so you just install the service and deploy — no IIS knowledge required.

The use of the jQuery family of technologies will be shared with Clarion.Net.  So becoming proficient with one group of technology will lead to being able to create web apps, mobile apps, native apps and hybrid apps.

News (short version)

I was working on a much longer post when I was alerted that if I didn’t post something (anything) real soon, then some heads were going to explode 🙂 —
so here is the shortest version I could quickly come up with, and I’ll follow with several small-ish posts.

On the Win32 side:
Expect a new release of Clarion8 out this week – possibly later today if all goes according to plan. Clarion9 is getting close to where we’ll release it to
an initial group of alpha testers, that being a precursor to widespread beta and official release.

On the .Net side
Clarion.Net is being updated to .Net 4.x compatibility, while still maintaining support for earlier .Net versions. It seems most of our developers are strongly interested in more capabilities to share code between .Net and Win32, and we’re working on further improvements in that area (we already support a builtin system for exposing .Net assemblies to Win32). With the push towards mobile and tablets, we’re working on templates that can address that very real need.

As we all know MS has an established history of pushing a new technology as the next “big thing” and then sweeping it under the rug a few years later. We don’t know if Microsoft will back off its Windows 8 strategy in the near future, or a few years down the road (like Zune and Silverlight). But after following MS down the path of WebForms, WinForms and Compact Forms only to have them mostly killed by MS, we’re avidly avoiding the MS trail of dead technology.

So in closing I want to suggest that jQuery, jQuery UI and jQuery Mobile(touch-optimized version of the jQuery framework) for smartphones and tablets will allow you to create a single app that can run on all popular smartphone and tablet devices (and desktop platforms). jQuery supports iOs, Android, Windows Phone, BlackBerry, Symbian, Palm webOS and other devices. So how does that fit into Clarion.Net and Clarion Win32? Well I’ll have to explain that in a separate post.

New functionality challenges new release

The new functionality I mentioned in the previous post took a bite out of our planned release timeline.  The functionality in question is the .Net implementation of our Win32 BrowseBox Behavior implementation.  We had aimed to have the support implemented across platforms (desktop/web) and across the data access models (ADO,Linq,FileDrivers).   This is what we have for the web side:

BrowseBox Behavior for the web


as you can see its very similar to what we have on the Win32 side of things.  For ASP.Net there are some new properties that are needed.  In particular we have to account for the stateless environment – each page access occurs as if it were the first time it has ever happened.   Hence the options for where the page will get its range limit value (as shown in the dropdown – and sure to expand shortly).

The BrowseBox Behavior implementation will bring a lot of code-free functionality to your web and desktop apps.  We’ll wrap this up tomorrow and release with whatever functionality exists (check the readme for the release state).

Another area where you’ll notice a huge improvement is the processing of the T4 template registry – it is now about 90% faster!

And we also have some nice news for the upcoming Win32 release but I’ll post about that tomorrow.

What’s coming up

We’re currently working on updates for both Clarion 8 and Clarion.Net.  On the C8 side we’re focusing on the first maintenance release for 2012 – lots of bug fixes and some popular feature requests.  On the .Net side we’re working on the next iteration of the 3-tier templates for both desktop and ASP.Net apps.  Additionally we’re adding the option to use the Clarion LINQ provider as the data model, bringing in ABC-like FILE access to your TPS (and other ISAM) tables.  We’ve simplified the steps needed to create the 3-tier app such that running the wizard creates both the model and the base application – and attaches all required extensions automatically.  End result – you won’t have to do much more than just select your Dictionary and then select the data model.  And if you choose the Clarion.Linq model there is no ADO.Net connection to configure.

We expect to release C8 next week to external testers, and a general release to follow the week after.  We’ll be ready to release the updated T4 templates around the same timeline, and once we’ve firmed up the changes we’ll schedule a webinar on ClarionLive.  The webinar will focus on how to use the templates (as opposed to how to write T4 templates).


Clarion.Net update

An update for Clarion.Net is out today.  It has a good number of fixes and delivers the previously described feature that automatically exposes Procedures you select so that they are visible to Clarion Win32 Apps.  I wrote about this a while ago, so I’ll refresh you on it (this is straight from the Help file):

1) In the Clarion# Program’s GLOBAL MAP, add both the NAME and PUBLIC attributes to the PROCEDURE prototype

For example in your Clarion# global Map:


! Procedures exposed for Win32 access must have both the NAME and PUBLIC attributes
SayHello                     PROCEDURE(),NAME(‘SayHello’),PUBLIC
SayTheName            PROCEDURE(string theName),NAME(‘SayTheName’),PUBLIC


2) On the Clarion# Project properties dialog, turn on the checkbox: Export Global named procedures and create Clarion Win32 LIB file

This step causes a .LIB file to be created, its location is set according to your RED file, or you can specify the output path in the Project

3) Copy both the .LIB and the Clarion# DLL to your Win32 project folder.  You also must copy any assemblies (DLLs) that your Clarion# DLL references, for the minimum you need:



4) In the Clarion Win32 program prototype the Procedure(s), and add the PASCAL and DLL attributes. If you need to pass a string value by address also add the RAW attribute.



! Calling Clarion# Procedures, you must use the PASCAL Attribute and set DLL(true)
SayHello            PROCEDURE(),NAME(‘SayHello’),PASCAL,DLL(TRUE)
SayTheName   PROCEDURE(*cstring theName),NAME(‘SayTheName’),PASCAL,RAW,DLL(TRUE)




In the initial implementation (its already changed internally),  you might run into a “gotcha” when you get to step 2.  In order to expose the Procedures for use in a Win32 program the binary Clarion# DLL file has to be disassembled back to IL code, the IL code is then modified, and then the IL code has to be assembled back to a binary (PE format) file.  To do this there are two programs from the .Net SDK that have to be found; Ilasm and Ildasm.  In the current implementation the location for those files is stored in an external .config file, and if they are not found (Ilasm and Ildasm), you’ll get an error message telling you to edit the path stored in Dllexport.exe.config.  In the next release we’ll have an improved implementation that finds these automatically on all OS’s (32 or 64 bit).

You’ll find an easy to understand example showing how this works in the .SamplesWin32toDotNet folder.

DevCon, Clarion8, Clarion.Net and more

I did a short talk at the start of today’s ClarionLive session. John and Arnold had posted that I’d be there and the room filled up really fast. In case you missed it, here is what I covered:

1. SoftVelocity and ClarionLive are co-organizing the next Clarion DevCon, which will be held in Denver Colorado, (same location as the last ClarionLive conference) for November 11-13, 2011. It’s sure to be a great event! I’ve heard the venue is incredible, and I know the content will be even better. In the weeks ahead we’ll be announcing the details on the session topics.

2. The initial early release of Clarion8 is going out today!
A few notes on the C8 release:
– You’ll get your chance to try out all the new UI features, like the Gradient support on Toolbar controls, the new Slider control, the 3-state Checkbox control, the vastly improved look for disabled images and icons, PROP:NoThemed support to allow transparent SHEET when the application is using a manifest, and much more.
– All told there are already over 65 new features and improvements, as well as about 150 fixes and changes.

– You’ll have some long sought after improvements in the IDE; like remembering the last edited EMBED point, and the ability to edit data as Text. But you’ll have to delve into the readme for the complete list. A lot of hard work has gone into this release, and we hope you will love it.

– What to expect after the install:

  • Clarion8 inherits all Clarion versions set up in Clarion 7, so you can start using the Clarion8 IDE right away
  • You should check with the 3rd party vendors that you use – but if you copy your .ClarionAccessory folder from your Clarion7.3 install folder into your Clarion8 folder most of your add-on tools should be ready to use as-is in a C8 App. The exceptions are those that have explicit checks for the Clarion version number, unless they use a greater than or equal condition. Also any tools that ship local link LIBs should be rebuilt just as a matter of routine sanity/safety.
  • The Dictionary format was updated in Clarion8, so expect an upgrade message upon open of the Dct or App

And that’s about it, this update should be absolutely painless, and it brings some very nice new features that your end-users can see, and some big productivity gains.

Back to the announcements:

3. Next week we’ll release an update for Clarion.Net – no AppGen.Net yet, but it will deliver the bridging technology that allows you to very easily call .Net procedures from your Clarion Win32 programs without the use of COM or C++ wrappers.

4. I’ll be doing short talks on ClarionLive at least twice per month in order to share the latest news on what we’re up to, and in general what’s happening with Clarion. I can’t thank John and Arnold enough times for the incredible resource they have created for the entire Clarion community!

Clarion.Net update

The AppGen for Clarion.Net is making steady progress (despite a few wild rumors to the contrary).  It’s a given that the progress is much slower than we would like, and in moment I’ll explain why that is the case. The core of Clarion.Net just like Clarion Win32, is not the AppGen, but is the Clarion language and Clarion runtime function library.  For those who are willing and capable of writing their own code (as opposed to generating it), Clarion.Net has long been both productive and complete. Let’s take stock on what we have now.

Well first and foremost we have the Clarion language, extended to be able to take full advantage of the .Net Framework while maintaining compatibility with Clarion syntax and language features. Let’s not underestimate the importance of this. I know there are those developers who claim they don’t care what the language is, but they are the minority. For most of us, the language we read and write to build our applications has great significance.

Next we have the Clarion Runtime, every function we have in Clarion Win32 we also have in Clarion.Net. The entire runtime has been ported to 100% verifiable .Net code with the exception being Window structures and the corresponding Accept loop and its related functions. So we lost Window structures, but did we gain anything in the trade? Yes we did, we gained the ability to seamlessly work with any add-on UI component library available. As you know Window structures are constrained to the core set of controls that we have had since the introduction of the Clarion for Windows product. Not so for Clarion.Net, the world of add-on controls is now wide open. And when we talk about the Clarion runtime let’s not overlook that this support encompasses the Clarion Driver technology. Driver support is bread and butter for most of us.

Is there anything else? Can we ignore what might well be the most important reason for some? Clarion.Net enables you to use you existing Clarion knowledge to build and deploy .Net applications for all of the platforms supported by .Net (Desktop, Web, and Mobile). Of course you could pick up a new language, and in a few years be a master of it. But your knowledge of the Clarion language shouldn’t be taken lightly, it’s a valuable asset.

Is that all? You have access to the entire.NET Framework and all of its classes and methods, including XML Web service classes. You have painless interoperation with both COM and native code Libraries. Clarion.Net programs and code can be integrated seamlessly with any other .Net languages; inheriting from classes created in other languages, invoking and being invoked by methods written in other languages, in other words you can use any library written in any .Net language, the same as if it were written in Clarion.Net. And the reverse is true.

So that’s what we have now, but what we’re missing is the code generation that separates Clarion from all competitors. As you may know the template language used in the new AppGen.Net is a complete departure from the syntax used by the templates in our Win32 Application Generator.  In place of the Clarion template language we use an extended set of T4 template directives. The extended set of T4 template directives include equivalents for our #PROCEDURE, #CODE, #GROUP, #CONTROL, #EMBED and #AT and #EXTENSION directives as found in our Win32 template system. And there is the root cause of the delay. The T4 engine has many advantages for generation of .Net code – but it’s primarily capability by design is for generation of individual classes and code snippets. The base premise of Clarion code generation is one of round-trip code generation, embedded code within the generated code block, generation of entire applications, and at the core, an Application tree that represents the structure and relationships of procedures within the application.  We very badly underestimated the complexities of imposing this required functionality onto the T4 engine, and it cost many more man-hours than we projected in our most generous estimations. We apologize for that, as we know a lot of Clarion users are purely AppGen developers, and are not going to be productive without the code generation functionality. But on the plus side, we now have the prerequisite functionality working, almost completely. And our stated plan to make the templates available on a public subversion repository so that users have instant access to updates and fixes, and have the ability to contribute new features and fixes (or even new templates and template sets) remains central to our plans (both for .Net and Win32).

The long-term goals remain unchanged; to create a code generation environment that opens the doors to WinForms, WebForms. Compact Forms, WPF and Silverlight. And in fact beyond those platforms, the new AppGen will open a path to Android and iOS. In order to get it into your hands faster, the initial templates will scale back on some of the optional features like the option to generate test cases (nUnit) for aspects of the APP. That can added later, by us, or by the community.

In the interim before the release of the AppGen for .Net we’ll be releasing an update to Clarion.Net that has a number of fixes and delivers the new technology that allows you to easily expose Clarion.Net methods to your Win32 Clarion applications.

Happy Holidays from SoftVelocity

From all of us at SoftVelocity, we would like to take this opportunity to wish you and your families a very Merry Christmas and a Happy and Prosperous New Year.

Here is our Holiday hours of operation for the next few days:

12/24 – Closed at Noon (EST)
12/25 – 12/27 – Closed
12/28-12/30 – Open for business, normal hours.
12/31 – Closed

Of course, our support newsgroups are always open 24/7, and you can always purchase our products online anytime at

A more detailed blog on Clarion versions 7.3, 8 (Beta), and Clarion.NET will follow here very soon.

All the best! We appreciate your business and support, and thank you!

Upcoming releases and news from Denver

The Clarion User conference was a great success. I presented the keynote remotely, and in this post I’ll cover the highlights of the presentation.

First on the Clarion for Windows Win32 side – I mentioned that the next release for Clarion 7 will be version 7.3, and in that release we’ll deliver several key RTL bug fixes and additional fixes for ReportWriter and the IDE. The 7.3 release will be ready to go out around mid-month.  I also did a brief demo of Clarion8, I only touched upon some of the new features already implemented, such as the new “edit as text” mode for the Data pad, and the new locators added to every list in the Dictionary editor (and added to the Data pad as well).  I also announced that we’ll be making an early access release for Clarion8 available to everyone with a subscription, and that will be ready by the end of this month.

On the .Net side I showed a short preview of the .Net Application Generator UI, and Pierre did further demonstrations during the conference. I explained that we are busy writing the .Net templates – and that the process of writing and testing the templates leads to bug fixes in the code generation engine.  With lots of hard work, and a bit of luck, we hope you’ll see a beta release in December.  I also mentioned that we’ll be putting all the templates (.Net and Win32) into a repository that will be open to the community. Doing this will allow Clarion developers instant access to the latest templates, and any template fixes or changes, and it will also allow Clarion developers to contribute their own templates and to participate in extending and refining existing templates. Later this week I’ll post another blog with some screenshots of the AppGen.Net UI – and as always we look forward to your feedback.

Clarion T4 template walk-through

T4 templates have a simple ASP.NET-like syntax and consist of processing directives, text blocks and code blocks. For this discussion we’re using the attached file which is a Utility template. Download it from here

We have two types of Utility Templates; DCT Utility Templates and ApplicationUtility Templates. Within the IDE when the “Document” tab that has focus is a .DCT or an .APPX the “Run Utility Template” menu item under the File menu is enabled, and depending on the type of the active document, the “Run Utility Template” Menu item will show a Selection Dialog displaying the appropriate Utility Templates for the document (DCT Utility Templates or Application Utility Templates) The big difference between a standard template and a Utility Template, is that the when the Utility Template is executed, the code will not output any text/code automatically. The template developer must define the output using the built-in Open/Close or Create/Close methods.

The DCT Utility template focuses on the DataDictionary object. The DataDictionary object is of type IDataDictionary, and using the IDE’s code completion we can learn how to use it; seeing its properties and methods with the complete descriptions. The DataDictionary object is very straight forward and easy to undertand. For example, it’s likely pretty clear that “this.DataDictionary.Tables” returns all the tables defined in the Dictionary.

The Application Utility template also has the DataDictionary object, but it has another object called “Application”. And of course you can query “this.Application.Procedures”, and guess what that returns? Yes you guessed it, all the procedures defined in that .APPX file.

Let’s do a walk-through of our simple DCT Utility template.

We’ll start with a look at Directives. The syntax of a directive is:

<#@ DirectiveName [ParameterName = “ParameterValue”] #>

for an example look at line 1 from the attached template:

<#@ template language=”C#” debug=”true” type=”Utility” name = “DCTTreeWizard” chain=”Clarion.File”#>

The “language” parameter specifies which language is used in the code blocks of the template, and in this case we specify C#.

The “debug” paramater allows you to debug templates. When that parameter is on, and the corresponding IDE option is also on, the template source code files are copied to the %root%..Templatesdotnet folder. And when there is an error in compiling the template (compilation occurs when you register the template), the error is displayed in the Error pad, and you can then double-click on the error and the .TT file with the error is opened for editing at the line with the error.

The “type” parameter specifies the type of template, current possible types are:

The “name” parameter assigns a name to this template, and finally the “chain” parameter specifies the template family.

Lines 2-6 use the “assembly” directive:
<#@ assembly name=”mscorlib.dll” #>
<#@ assembly name=”System.dll” #>
<#@ assembly name=”System.Drawing.dll” #>
<#@ assembly name=”System.Design.dll” #>
<#@ assembly name=”System.Drawing.Design.dll” #>

The “assembly” directive identifies an assembly to be referenced by the template so that you can use types within that assembly from within the code in your template. Using the assembly directive is equivalent to using the Add Reference feature in the Clarion# IDE. The “assembly” directive does not affect the source code of the compiled template.

Lines 7-12 use the “import” directive.
<#@ import namespace=”System.Collections.Generic” #>
<#@ import namespace=”System” #>
<#@ import namespace=”SoftVelocity.TextTemplating” #>
<#@ import namespace=”System.Drawing” #>
<#@ import namespace=”System.Drawing.Design” #>
<#@ import namespace=”SoftVelocity.DataDictionary.Design” #>

The import directive allows you to refer to types within a text template without providing a fully qualified name. The “namespace” parameter is transformed into a .Net “using” directive in the compiled template.

Now look at line 13:
<#@ property processor=”PropertyProcessor” name=”OutputFile” type=”System.String” defaultValue=”none” editor=”System.Windows.Forms.Design.FileNameEditor”#>

The “property” directive defines an editable property of the template. It corresponds to #PROMPT in our Win32 template language. The parameters are probably self-explanatory; “name” is the name that is displayed in the property grid, “type” defines what type of value is accepted, “defaultValue” is exactly as the name suggests, and “editor” is the object that is used to visually edit the property. The “editor” can be just the default; a simple text string, but it can also be a dialog window, a dropList, a checkbox, or by default a simple textBox.

Line 14 is interesting: <#+ string _OutputFile = “”;#>

the <#+ tag indicates a template helper block. The helper block allows the template developer to add code at the TextTransformation Class level. The code added can be a Method, a Field, or a Property declaration.

If a Method is declared within the helper block, it can be compared to a #GROUP from our Win32 template language. Embeds can also be declared inside a helper block.

for example:

<#+ void MyPseudoGroup() {#> <#% MyEmbed #> <#+}#>

In this case when the method MyPseudoGroup is called, the content of the MyEmbed will be also executed.

Line 15: <# this._OutputFile = this.OutputFile;#>

just the value set in the “OutputFile” within the property directive to the internal _OutputFile variable.

Line 16: <# Create(this._OutputFile);#>

calls an internal method that creates a file on disk to receive the generated text (code or other text). It corresponds to our Win32 counterpart #CREATE.

Line 17:

is a text block, as there are no template directives surrounding it. Text blocks are copied to the output “as is”, with no further processing.

Line 18: – Listing for Dictionary: <#= this.DataDictionary.FileName #>

mixes a text block: ‘– Listing for Dictionary: ‘ with an expression block:
<#= this.DataDictionary.FileName #>

You use expression blocks in text templates to add strings to the generated text output. In this case we’re asking for the name of the Dictionary that we’re processing. Expression blocks are delineated by using the <#= template tag. The syntax is: <#= ExpressionCode #>

Lines 19-49 use code blocks. The syntax for a code block is: <# Code block #>

Code blocks can generate template output. In our template the code block uses a few nested foreach loops to walk the dictionary. We’re using a mix of text blocks and expression blocks to write the details of the dictionary to the output file. Code blocks can use any available .NET APIs. In this template we’re using the DataDictionary API to output the Dictionaries collections and properties; Tables, Columns, Keys and Relationships.

I hope this walk-through has provided a good introduction to the new template syntax used in AppGen.Net.  For those who are thinking of writing some T4 templates the attached example is a good starting point to get familiar with the essentials. Next time we’ll go a bit deeper into the template syntax.