Clarion 9.1 under the hood - Part 1

When I get a new Clarion release one of my favorite things to do is pull out Beyond Compare and see what changes have been made to the shipping product. That won't tell me much if anything about the compiled part of the product, but as Clarion ships with a lot of template and Clarion source those comparisons are often revealing. 

But first a quick note about using Custom Setup on install. Besides choosing an install directory, you can select up to five optional features. In the Clarion 9.0 install all but the Report Writer were selected by default. When I ran the 9.1 install all options were unselected by default. I manually chose the options I wanted. 

New (and moved) stuff

The first new file I spotted was data\options\CodeSnippets.xml, but it turns out this is SharpDevelop-templates.xml under a different (and more appropriate) name. The contents haven't changed significantly, but I think it's still worth remembering what's here. The original file no doubt had the VB and C++ snippets; SoftVelocity added Clarion (CLW) snippets:

  • acceptl - accept loop
  • caseof - Case Of
  • casea - case accepted()
  • caseev - case event()
  • casesel - case selected()
  • execb - execute code block
  • ifbreak - if Condition then break (inside a loop)
  • ife - If Else
  • loopi - Loop i = initial TO limit [ BY step ] LOOP i = | TO limit [ BY step ]
  • loopu - loop until
  • loopw - loop while
  • classdcl - class declaration 
  • filedcl - File Structure starter 
  • loopqueue - loop through a given queue
  • groupdcl - group structure starter
  • queuedcl - queue structure starter
  • routinedef - routine starter
  • procdef - procedure starter

and ClarionSharp (CLN) snippets:

  • ife - IF Else
  • omdi - open an MDI child window ! create instance of a window and open as an MDI child
  • tryc - Try Catch
  • trycf - Try Catch Finally
  • tryf - Try Finally
  • loopw - Loop While
  • loopu - Loop Until
  • loopi - Loop i = initial TO limit [ BY step ] Loop i = | TO limit [ BY step ]
  • caseof - Case Of
  • execb - Execute code block

Some code snippets require you to select some text first. For instance, type MyClass then highlight the text and press Ctrl-J. Select the class declaration snippet:

Tada!

MyClass                                         CLASS !, TYPE 
CONSTRUCT                                           PROCEDURE 
DESTRUCT                                            PROCEDURE 
                                                    !Properties 
                                                    !Methods 
                                                END

You'll still need to declare and write any method implementations, of course. 

If you don't select some text first you'll get a different result:

    CLASS !, TYPE 
CONSTRUCT                                       PROCEDURE 
DESTRUCT                                        PROCEDURE 
                                                    !Properties 
                                                    !Methods 
                                                END

But that's easily remedied - just stick a label in front of CLASS and reformat with Ctrl-I. 

The file structure code snippet is similarly pretty simple:

MyFile                                          FILE, DRIVER() 
                                                    RECORD 
                                                    END 
                                                END

I'm not sure I'll ever bother with snippets for IF statements and the like, and for classes I rely heavily on the ClarionLive Class Creator, But I'll keep an eye out for code I'm writing repeatedly that might fit the constraints of CodeSnippets.xml. 

There is a new toolbar color scheme called Win8Blue. You can choose it via Options | General | Appearance.

Email templates

There is a new template called SVCommunicationSupport. This template includes a global extension with options for sending email and text messages.

Both email and SMS are sent via SMTP. The two settings windows are almost identical:

There are matching control templates. Drop a Send Email button on a window and select Actions to fill in the remaining settings:

Here are the SMS settings:

Email classes

There are a bunch of new source files, which I'll cover in alphabetical order.

The email files include:

  • ClaMail.CLW
  • ClaMail.INC

ClaMail.INC contains three class declarations:

  • SMSMailClient CLASS,TYPE
  • SMSClient CLASS(SMSMailClient),TYPE
  • MailClient CLASS(SMSMailClient),TYPE

The release notes indicate that classes were added to make it possible to send email without needed to generate code via the templates, so presumably these are the classes in question.

Touch support

Touch support is declared in the following files:

  • CWTOUCH.CLW
  • CWTOUCH.INC
  • CWTOUCHDEF.INC

CWTouch.inc includes the following classes:

  • InputPoint
  • TouchPoint
  • InputData
  • TouchData

These classes are primarily data but each has a Next() method which, somewhat mysteriously, only returns NULL. 

The following COM interfaces are also defined:

  • IGestureResponder
  • IPointerResponder
  • ITouchNotifier
H5 Builder

The H5 product, which was demonstrated in a very early form at the 2013 DevCon, promises to blend "the best features of Internet Connect (IC) and Web Builder (WB), joined with the jQuery family and HTML5/CSS". The idea is to allow you to deliver Clarion apps as private web apps to business users (as opposed to large scale web sites). 

web-mobi

The SoftVelocity blog has more information: http://clarionsharp.com/blog/clarion-h5/

Although H5 is not yet fully included with Clarion 9.1, a number of files are shipping. They include:

  • H5BROKER.CLW
  • H5BROKER.INC
  • H5CLIENT.CLW
  • H5CLIENT.INC
  • H5CNTRLS.CLW
  • H5CNTRLS.INC
  • H5EVENT.CLW
  • H5EVENT.INC
  • H5FILES.CLW
  • H5FILES.INC
  • H5HTML.CLW
  • H5HTML.INC
  • H5HTTP.CLW
  • H5HTTP.INC
  • H5JSL.CLW
  • H5JSL.INC
  • H5LAYOUT.CLW
  • H5LAYOUT.INC
  • H5REPORT.CLW
  • H5REPORT.INC
  • H5REPORT.TRN
  • H5SERVER.CLW
  • H5SERVER.INC
  • H5SERVER.TRN
  • H5SINK.INC
  • H5STD.CLW
  • H5STD.EQU
  • H5STD.INC
  • H5TXTOUT.CLW
  • H5TXTOUT.INC
  • H5UNAUTH.HTM
  • H5WINDOW.CLW
  • H5WINDOW.INC
  • H5WINDOW.TRN

The H5 classes include:

BrokerClass                                 CLASS(WebDataSinkClass)
BrowserManagerClass                         CLASS
HtmlClass                                   CLASS(TextOutputClass),TYPE
HtmlFontClass                               CLASS,TYPE
HtmlItemClass                               CLASS,TYPE
HttpBaseClass                               CLASS
HttpClass                                   CLASS(HttpBaseClass)
HttpPageBaseClass                           CLASS
HttpPageBrowserClass                        CLASS(HttpPageBaseClass)
HttpPageJavaClass                           CLASS(HttpPageBaseClass)
JslEventsClass                              CLASS
JslManagerClass                             CLASS, TYPE
LayoutCellClass                             CLASS,TYPE
LayoutHtmlClass                             CLASS,TYPE
RangeClass                                  CLASS,TYPE
ReportImageClass                            CLASS(ReportItemClass),TYPE
ReportItemClass                             CLASS(HtmlItemClass),TYPE
ReportStringClass                           CLASS(ReportItemClass),TYPE
ShutDownClass                               CLASS
SubmitItemClass                             CLASS
TextOutputClass                             CLASS,TYPE
WebAreaClass                                CLASS(WebControlClass),TYPE
WebButtonClass                              CLASS(WebControlClass),TYPE
WebCaptionClass                             CLASS(WebAreaClass),TYPE
WebClientAreaClass                          CLASS(WebAreaClass),TYPE
WebClientManagerClass                       CLASS(WebClientManagerInterface)
WebClientManagerInterface                   CLASS(WebDataSinkClass)
WebControlClass                             CLASS(HtmlItemClass),TYPE
WebControlListClass                         CLASS,TYPE
WebDataSinkClass                            CLASS
WebFilesClass                               CLASS
WebFrameClass                               CLASS,TYPE
WebHotlinkClass                             CLASS(WebControlClass),TYPE
WebHtmlButtonClass                          CLASS(WebButtonClass),TYPE
WebHtmlCheckClass                           CLASS(WebControlClass),TYPE
WebHtmlCloseButtonClass                     CLASS(WebControlClass),TYPE
WebHtmlEntryClass                           CLASS(WebControlClass),TYPE
WebHtmlGroupClass                           CLASS(WebControlClass),TYPE
WebHtmlImageClass                           CLASS(WebImageClass),TYPE
WebHtmlItemClass                            CLASS(WebMenuBaseClass),TYPE
WebHtmlListClass                            CLASS(WebListClass),TYPE
WebHtmlMenuClass                            CLASS(WebMenuBaseClass),TYPE
WebHtmlOptionClass                          CLASS(WebControlClass),TYPE
WebHtmlPromptClass                          CLASS(WebControlClass),TYPE
WebHtmlRadioClass                           CLASS(WebControlClass),TYPE
WebHtmlRegionClass                          CLASS(WebControlClass),TYPE
WebHtmlSheetClass                           CLASS(WebControlClass),TYPE
WebHtmlStringClass                          CLASS(WebStringClass),TYPE
WebHtmlTabClass                             CLASS(WebControlClass),TYPE
WebHtmlTextClass                            CLASS(WebControlClass),TYPE
WebImageClass                               CLASS(WebControlClass),TYPE
WebJavaListClass                            CLASS(WebListClass),TYPE
WebJQueryButtonClass                        CLASS(WebControlClass),TYPE
WebJQueryCloseButtonClass                   CLASS(WebHtmlCloseButtonClass),TYPE
WebJQueryListClass                          CLASS(WebListClass),TYPE
WebJQueryStringClass                        CLASS(WebStringClass),TYPE
WebJQueryToolButtonClass                    CLASS(WebJQueryButtonClass),TYPE
WebListClass                                CLASS(WebControlClass),TYPE
WebLiteralClass                             CLASS(WebControlClass),TYPE
WebMenubarClass                             CLASS(WebAreaClass),TYPE
WebMenuBaseClass                            CLASS(WebControlClass),TYPE
WebNullControlClass                         CLASS(WebControlClass),TYPE
WebPageClass                                CLASS(WebControlClass),TYPE
WebReportClass                              CLASS,TYPE
WebServerClass                              CLASS
WebStringClass                              CLASS(WebControlClass),TYPE
WebToolbarClass                             CLASS(WebAreaClass),TYPE
WebWindowBaseClass                          CLASS(WebControlListClass),TYPE
WebWindowClass                              CLASS(WebWindowBaseClass),TYPE

64 bit functions

Also new in Clarion 9.1 is a new set of RTL functions for dealing with 64 bit signed and unsigned integers. The functions are declared in i64.INC and provide the following functionality:

  • Return sign of passed 64-bit signed integer
  • Negate value of passed signed 64-bit signed integer variable
  • Negate value of passed signed 64 bit signed integer variable if it is negative
  • Compare value of passed 64-bit integer with 0
  • Check that value of passed 64-bit integer can be stored to 32-bit integer without truncating
  • Assign 32-bit value to passed 64-bit integer variable
  • Assign 64-bit value to passed 64-bit integer variable
  • Store 64-bit integer value to 32-bit integer variable
  • Store DECIMAL value to 64-bit integer variable
  • Store 64-bit integer value to DECIMAL variable
  • Shift value of 64-bit integer value to given number of bits to left or to right and store result to another 64-bit integer variable
  • Shift value of 64-bit variable to left to given number of bits and store result to another 64-bit integer variable
  • Shift value of 64-bit variable to right to given number of bits and store result to another 64-bit integer variable
  • Add value of one 64-bit integer variable to another one
  • Subtract value of one 64-bit integer variable from another one
  • Assign sum of two 64-bit integer values to passed 64-bit integer variable
  • Assign result of subtraction of two 64-bit integer values to passed 64-bit integer variable
  • Multiply value of 64-bit integer variable by 2
  • Multiply value of 64-bit integer variable by 10, add passed 32-bit value and store result back to variable
  • Multiply two 64-bit integer values and store result to passed 64-bit integer variable
  • Divide value of 64-bit integer variable to 10 and store quotient back to variable
  • Store result of division of two 64-bit signed integer values to passed 64-bit variable
  • Store result of division of two 64-bit unsigned integer values to passed 64-bit variable

Next time

That's it for the new files. Next week I'll take a look at some of the many changes to existing files in 9.1.