Clarion 9.1 First Look

Clarion 9.1 build 10638 has gone out to third party vendors. As has been noted previously, the two big items in this release are touch support and reg-free COM. 

There are two main things to note about touch support. 

  1. All apps automatically have touch support, including the ability to scroll a browse with a swipe gesture, and 
  2. If you need extended touch support (e.g. gestures) all of that is available as well. 

I don't have a usable tablet handy at the moment so I can't yet give my first impressions of the touch support, but on January 17 Mark Goldberg gave a fairly lengthy ClarionLive presentation on touch support which included a camera view of his Surface Pro tablet. 

I'll take a look at reg-free COM support next time, but they key point is that as with touch support, this functionality is there automatically, with the proviso that the COM object is in a side by side assembly. That is, the COM object's DLL must have an appropriate manifest file, so I imagine there may be some growing pains as Clarion developers attempt to deploy a variety of COM objects with their apps. 

Release notes

The release notes are as follows - I'll touch on a number of the release note points as I look at the changes in the installed files.  

Release notes
  • FEATURE:: Support of Touch input
  • FEATURE:: Support registration-free activation of COM objects from side-by-side assemblies
  • FEATURE: Added support for routines in DCT triggers code.NOTE: Restrictions: the routines name should not start with the word "routine" (will make the code generate incorrectly). After the first routine is found the rest of the code of will be treated as routine code and output in column 1 after the RETURN of the method
  • FEATURE:: Added two new methods to the resize class to know when resizing starts and finishes: WindowResizeBegin and WindowResizeEnd
  • FEATURE:: Before building if the process CCC.EXE is found running the IDE will try to stop it, if is successful it will add a message in the Error List (Message) This was added to stop the error on building related to the Catalyst Control Center Utility (aka CCC.EXE)
  • FEATURE:: Files for custom handling of touch input in programs; CWTOUCH.CLW, CWTOUCH.INC, CWTOUCHDEF.INC
  • FEATURE:: JSON: Added an example that show how to serialize and deserialize a QUEUE to/from json
  • FEATURE:: JSON: Added methods to the JSON Class to parse the Json results
  • FEATURE:: JSON: Allow to use a PICTURE to format numbers in the ToJSON groups and queue and to DEFORMAT the numbers with @BOOL support
  • FEATURE:: JSON: class Added methods to the JSON class to parse the json string and retrieve the names , values (simple or arrays) of a json pair
  • FEATURE:: JSON: class Added methods to the JSON class to deserialize GROUPs and QUEUEs
  • FEATURE:: Option setting to set the length of the Clarion code Editor line before adding a &|Tools-Options-TextEditor-Clarion Specific Options NOTE: for now this only apply to the hand coded Windows (Ctrl+D), not the App windows
  • FEATURE:: QuickXMLParser added Trace method that is called every time the parser executes an interface method. (use OutPutDebugString)
  • FEATURE:: Send Email and Send SMS functions added to ClaRunExt
  • FEATURE:: Setting to enable to automatically kill the process (App's Exe) before doing a build (only available on EE) Options-General-Project and Solutions-"Kill Process before build"
  • FEATURE:: Show info about address in the call stack in form <module name>:<offset> if module has no debug info or address can't be resolved
  • CHANGE: Extend sizes of variables used to hold a procedure's prototype and parameter list
  • CHANGE: ABC Browse Class, method ReplaceSort is now virtual
  • CHANGE: ABC: Added support to the WindowExtenderClass to check if a processes other than the current one is running and be able to bring them to the front
  • CHANGE: ABC: Added support for Only one Instance of the procedure when the procedure is declared in a DLL
  • CHANGE: Added support to the GENERATEDClass module and SourceClass procedure template to generate generic members
  • CHANGE: Additional functions of the i64 family
  • CHANGE: Default vale for the DCT QuickView is Advanced before it was Simple
  • CHANGE: Default value to Require Dictionary is set to false
  • CHANGE: Fields of type reference-to-typed-GROUP are allowed now in structures
  • CHANGE: ICSharpCode.SharpDevelop.Gui.FormLocationHelper is deprecated, please use ICSharpCode.Core.FormPositionService.Instance instead.
  • CHANGE: IListControl new method GetSelectedItem
  • CHANGE: If the selection of the derived from column creates an error now the error is displayed in the error pad
  • CHANGE: Improve the Parser Thread start/stop process
  • CHANGE: Old default properties were not matching the name of the properties files used by the IDE.
  • CHANGE: Old files named SharpDevelop-teplates.xml was renamed to CodeSnippets.xml to easily identify it with the options it store
  • CHANGE: Set message text for constraint type run-time errors; 401: "Stack overflow", 402: "Null pointer de-reference", 404: "Arithmetic overflow", 405: "Value out of range", 406: "No return from function", 407: "No matching case label", 408: "Division by zero", 409: "Index out of range"
  • CHANGE: Solution Explorer (Clarion Project), when an item from the solution like a Icon, CLW, etc. is removed the previous item is now selected instead of going to the parent node
  • CHANGE: Support Windows 8.1 in the MANIFEST command for the linker
  • CHANGE: SystemString class: Format method is renamed to FormatString
  • CHANGE: The font for the TopSpeed ODBC driver dialogs has been changed to be consistent with the rest of the product
  • CHANGE: Update ClaTalk template to use the ClaRunExtClass
  • CHANGE: Updated the IPEXEC parameter parser to use equates for the states (faster than strings)
  • CHANGE: When Controls in the DCT are created (WINDOW/REPORT field representations) the Parser was re-reading the EQUATES.CLW and BUILTINS.CLW files from disk, now it caches those files after the first read. NOTE: If a user is modifying those files the changes will not be reflected until the IDE is re-started. NOTE2: If the user is using multiple EQUATES.CLW or BUILTINS.CLW files from multiple .Red files only the first one used will be processed for the DCT Control creation and Code Completion.
  • FIX: Procedure parameters could be imported wrong from a partial TXA (TXA having no [APPLICATION] section)
  • FIX: AppBrokerServiceManager was not showing the correct icon when the service was stopped
  • FIX: Clicking on the cancel button during DCT conversion or other Dct process was not stopping the process but just closing the window dialog
  • FIX: Code Completion was differentiating between upper case and lower case file name extension.
  • FIX: DCT: Sometimes when the Column contained invalid data, selecting a new columns could cause a null exception based on the invalid data
  • FIX: DCT: When any validation error happen on a derived column and the child is selected, the error was not displayed
  • FIX: DCT: when converting the DCT and an expected error happen, the error were only added to the Pad but not displayed in a Message()
  • FIX: Fix typo in the Icon viewer
  • FIX: GET(file,key) did not work with the SQLite driver if the key components where not the first fields in the record structure
  • FIX: Generator did not generate &REPORT fields correctly
  • FIX: Horizontal scrolling by touch in LIST controls did not work
  • FIX: If an invalid shortcut was found at startup the IDE would shut down
  • FIX: If there was an error in a redirection macro in an included redirection file, then the dialog displaying the error message indicated that the problem was in the top level redirection file rather than in the included redirection file.
  • FIX: Incorrect text was displayed in the Toolbar Build Solution and Rebuild Solution buttons
  • FIX: PNG images with an alpha channel would not 'stretch'
  • FIX: Position of scrollable WINDOW or IMAGE control could be calculated incorrectly on scrolling or on changing the PROP:XOrigin or PROP:YOrigin properties
  • FIX: Possible memory leaks if LIST control uses styles
  • FIX: REGION, PROMPT, RADIO controls were not using the correct Color Editor in the Window Designed for some color properties
  • FIX: REPORT Format Section Dialogs were not using the correct color dialog
  • FIX: REPORT parts were not using the correct Color Dialog for the color properties
  • FIX: Reference assignments of NULL to variables of type &GROUP or &GroupType produced unwanted statics
  • FIX: Separator was spelled incorrectly in the TopSpeed ODBC driver configuration dialog.
  • FIX: Setting PROP:HScroll and PROP:VScroll to TRUE for an IMAGE control caused displaying of scrollbar even if its real size is not enough to fill the control rectangle
  • FIX: Shortcut editor allowed for invalid shortcuts to be added to the IDE
  • FIX: Size of fields for Justification and Place Over in the DCT were too small
  • FIX: Some IDE dialogs were not re-displaying and positioned properly after were displayed in a secondary display that was unplugged
  • FIX: Sometimes the Close All Documents command will not close all the open Documents.
  • FIX: Sometimes the Code Completion will not work if a , is used in the last position of a line
  • FIX: The DCT Editor allow to create a field derived from other field that could create a recursive list of parents
  • FIX: The build system could use the wrong redirection file if there were multiple projects in a solution and those projects were in different folders and there was a clarion90.red file in each of those folders
  • FIX: The first time you did a generate in the IDE the creation of the exp file might not work properly
  • FIX: The redirection system was not parsing the %THISDIR% macro correctly when doing a build
  • FIX: TopSpeed driver would leak memory if you used the TableList SEND command
  • FIX: Topscan: Default text of the column header could be built incorrectly
  • FIX: Topscan: Incorrect column picture could break displaying of data
  • FIX: Topscan: Possible assert failure on the browsing file for the first time
  • FIX: Unexpected errors could occur on compile/link time if the name of a File View object clashes with the name of some user declared object
  • FIX: Upgrading of pre-C7 apps could lose the generated flag from project items
  • FIX: When a severe error happens during generation of the App sometimes the Build process would start but it could not be stopped, leaving the IDE in an state that needed shutdown
  • FIX: When accessing Btrieve files that had a PDECIMAL field in them that was a key component of a key with the OPT attribute, if you did a binary level compare (eg SavedRecord = Record), this would sometimes fail. DOCUMENTATION: Update the Btrieve docs to document the NULLPDECIMALS = ON|OFF driver string.  
  • FIX: When there is a template that was missing the generation from the application pad could generate an exception and shutdown the IDE
  • FIX: When there is a template that was missing the generation of the App from the Application Pad could generate an exception and shutdown the IDE
  • FIX: You could create a local variable of type REPORT via the data pad. The data pad now restricts you to creating variables of type &REPORT
  • PTSS 34503: IPDVR - IPEXEC function parameters can not contain a ‘)’.
  • PTSS 40060: EDITOR HANGS - with specific sequence of lines removed, (code folding could not identify the parent)
  • PTSS 40093: - JSON Class ToJSON() returns a badly formatted JSON string
  • PTSS 40205: Clarion Chain Report Previewer zoom was not working over the image
  • PTSS 40233: TopSpeed 5.0 driver Prompt Screen issues 
  • PTSS 40267: Missing references after the import of the Clarion 6.3 app  
  • PTSS 40342: AbSql.clw: renamed label TextFile to SV_SqlScriptFile to avoid clashing with common user labels
  • PTSS 40406: REPORT reference goes haywire 
  • PTSS 40487: TXA import thrashes Parameters Entry 
  • REGRESSION: Adding a file to a project that could not be found via redirection added only the file name rather than the relative path to the file

Install program changes

During the install process I noticed this window, which I don't recall seeing in 9.0:

This isn't new functionality - in Clarion 8 you can already use the /CONFIGDIR switch, but it's nice to see the install program updated to set that switch up for you. 

Installed file changes

On the binary side there are no doubt numerous changes, but it's difficult to tell what they are from a file comparison. There is however a new executable called ClaRunExtSetup.exe. 

This file is related to the the Report to PDF template's Scan Copy Mode option, which lets you create scannable PDFs. From the help:

      Use Scan Copy Mode

This option supports use of any image format and any font. The WMF pages are converted to PNG so the resulting PDF is an exact copy.

** System Requirements

1. If you use this option you must deploy ClaRunExt.dll (located in the BIN folder).

2. The systems where this is deployed must have the Microsoft VC++ (x86) 2005 runtime installed

3. The systems where this is deployed must have the Microsoft .Net Framework 2.0 runtime installed

Both of these requirements can easily be installed using SetupBuilder, or with the ClaRunExtSetup.exe that can be found in the Clarion BIN folder.

This subject has been previously covered - see Clarion 9 apps using Report to PDF to require C++ redistributable? where Bob Z mentions this executable as coming in 9.1 

ClaRunExt.DLL is still present in 9.1, but ClaRunExt.lib has gone away. ClarunExt.INC has changed to include a class definition with methods for image manipulation and sending SMS and mail (there is a new ClaRunExt.CLW to match):

ClaRunExtClass      CLASS,TYPE,MODULE('ClaRunExt.clw'),LINK('ClaRunExt.clw',_ABCLinkMode_),DLL(_ABCDllMode_)
Inited                  BYTE,PROTECTED
Construct               PROCEDURE()
Destruct                PROCEDURE(),PROTECTED
Init                    PROCEDURE(),BYTE,PROTECTED
ImageToPNG              PROCEDURE(CONST *CSTRING fileNameIn),LONG!Save image to a PNG file, changing the fileName extension to PNG. Return 0 if no error and Error Number if there is an error
ImageToPNG              PROCEDURE(CONST *CSTRING fileNameIn, CONST *CSTRING fileNameOut),LONG!Save image to a PNG file with the name fileNameOut. Return 0 if no error and Error Number if there is an error
ImageRotateFlip         PROCEDURE(CONST *CSTRING fileNameIn, CONST *CSTRING fileNameOut, LONG RotateFlipType),LONG!Save image rotated or fliped. Return 0 if no error and Error Number if there is an error
ImageSaveThumbnail      PROCEDURE(CONST *CSTRING fileNameIn, CONST *CSTRING fileNameOut, LONG porcentage),LONG!Save image reduced in size. Return 0 if no error and Error Number if there is an error
SendSMS                 PROCEDURE(CONST *CSTRING SMTPServerHost, CONST *CSTRING SMTPLoginUserName, CONST *CSTRING SMTPLoginPassword, LONG SMTPPort, LONG SMTPEnableSsl, LONG showErrorMessage, CONST *CSTRING  fromAddress, CONST *CSTRING  toPhoneNumber, CONST *CSTRING  toCarrier, CONST *CSTRING  subject, CONST *CSTRING  textMessage),LONG
SendMail                PROCEDURE(CONST *CSTRING SMTPServerHost, CONST *CSTRING SMTPLoginUserName, CONST *CSTRING SMTPLoginPassword, LONG SMTPPort, LONG SMTPEnableSsl, LONG showErrorMessage, LONG receiveRequest, CONST *CSTRING messageBodyEncoding, CONST *CSTRING fromAddress, CONST *CSTRING toAddress, CONST *CSTRING replyToAddress, CONST *CSTRING subject, CONST *CSTRING htmlMessage, CONST *CSTRING embeddedImageFileNames, CONST *CSTRING textMessage, CONST *CSTRING attachedFileNames),LONG
                    END

The new class file is also interesting because it prototypes the various API calls needed for dynamically loading DLLs and uses them to call the functions in ClaRunExt.DLL. 

In ABBrowse there is a new GetSelectedItem method in the IListControl interface. This is used in GridClass.

FileDropClass has two new methods, IncludeEmpty and IncludeAll, and a new TextForAll property. 

PopupClass gets new SetNoIcons and GetNoIcons methods. 

There is a new ShowOutputProgress property on PrintPreviewClass which is used to optionally hide the progress window.

WindowResizeClass gets two new methods: WindowResizeBegin and WindowResizeEnd.

New touch source files

There are a number of new source in this 9.1 release. Three of these are for touch support:

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

New H5 source files

There are no H5 templates in this release, but I'm told good progress is being mode on the H5 project. There are however a number of new H5-related source files:

  • 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

 If you're looking to put some meat on those bones, here's the current class list:

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

There have been some minor changes to the InternetConnect classes but I don't know if they're related to the H5 project. 

The JSON class has a few new methods for string parsing. 

Other source changes

There are some new properties:

PROP:Locale           EQUATE(7A76H)  ! integer: SYSTEM or FILE LCID value
PROP:Codepage         EQUATE(7A77H)  ! integer: SYSTEM or FILE codepage value
PROP:NoFont           EQUATE(7A78H)  ! boolean:
PROP:TouchInterface   EQUATE(7A79H)  ! integer: get the interface to touch input

The QuickXMLParser (actually XMLParser) now has some debugging methods. 

I've never used the XMLParser class, but the source comments suggest that this is a SAX-type parser that steps through the XML and fires an event for each node it encounters:

! CLASS: XMLParser
!This is a none validate XML parser
!It is fast and use very low memory
!It can be very handy to parse trusted files that are valid
!The parser does not store or create any structure with the XML data
!instead it use an interface and call each method of that interface
!passing the XML Data.
!To use the parser the IXmlNotify need to be implemented.

Template changes

External procedures now have the "Only One Instance Allowed of the Procedure" prompt. The File Drop template adds prompts for "Include Blank Choice" and "Include 'All' Choice". 

There are some new trigger embed points. 

There's a new port template prompt to let you hide the output progress window. 

You can now optionally generate modules as generic, with an empty Member() statement. 

The UserControlClass procedure template now has this comment:

#! This control template is for testing only and not supposed to be the final version (WIP)
#PROCEDURE(UserControlClass,'UserControlClass','ClarionOOP'),WINDOW,PARENT(SourceClass(ABC))

SoftVelocity announced the UserControlClass template at DevCon 2013,  describing it as a template that lets you create a control or set of controls which are then wrapped up in a class for use in any other window. This has a lot of promise, but probably wouldn't be as widely used as H5 or touch support at least in the near term, which may be why it doesn't seem to have a higher priority. 

There are some new gradient color prompts for windows and fields. 

The ClaTalk.tpl template, which adds various kinds of support for email and SMS, is missing from my 9.1 install; perhaps this is an oversight. 

Usually when I go through release changes I come across existing code I never knew existed. One such is tutil.tpw, which contains a code template called CreateAtFromEmbed that does exactly what you'd think - you drop it into an embed point and it generates commented-out template code that you can use in your own templates. Nifty.Â