Monthly Archives: November 2012

SQLite and the new ABC SQLexecutor

Clarion 9 introduces a new driver for working with SQLite databases.  SQLite is one of the most widely deployed databases in use today. SQLite databases are widely used on both iOS and Android tablets and cell phones.  SQLite databases are useful in any situations where simplicity of administration and easy maintenance are more important than scalability.

The driver introduces a new prop; PROP:CreateDB. PROP:CreateDB is a command property that tells the SQL driver to create the SQLite physical database file that is specified in the OWNER attribute of the file. If the database file already exists, this command does nothing.  The existing database file will not be destroyed.

The CREATE statement converts Clarion data types to SQLite Data types using the following table:

Clarion Data Type SQLite Data Type
STRING CHAR
CSTRING VARCHAR
STRING(8);GROUP OVER(STRING);DATE;TIME DATETIME
DATE DATE
PDECIMAL NUMBER
DECIMAL NUMBER
BYTE TINYINT
SHORT SMALLINT
LONG INTEGER
SREAL FLOAT
REAL REAL
BLOB CLOB
BLOB,BINARY BLOB

However Clarion 9 introduces new ABC support so that you can easily deploy and execute SQL scripts. For example a create script like below;
CREATE TABLE Courses(
Number INTEGER,
Description CHAR(40),
CompleteDescription CLOB,
CONSTRAINT KeyNumber PRIMARY KEY (Number));
CREATE INDEX KeyDescription ON Courses(Description);

The new class executes SQL code as a series of commands separated by an end of statement marker which you specify.  Any errors encountered executing the script are reported using the passed error handler. In short, you provide an external file that contains your SQL script and its parsed and executed.  The SQL code isn’t limited to just Create and Alter database scenarios, you can execute any valid SQL code. And of course the new ABC SQL script support is applicable across any Driver and SQL backend.

Clarion 9 – Touch-enabled

Gartner is estimating that there will be 13 million enterprise tablet purchases next year, and 53 million by 2016. They predict that Windows 8 will grab 39 percent of the tablet market in 2016. You can be sure that you’ll have many users wanting to run your Clarion apps on their (Win8 Pro – x86 based) tablet.  And with the release of Clarion 9 you’ll be ready to deliver to them because the release of version 9 will add full touch support to the Clarion RTL.

Clarion 9 implements touch support into the ACCEPT loop with the addition of:

  • new event; EVENT:Pointer
  • new built-in function; POINTERDATA()
  • new SYSTEM property; PROP:PointerInterface

And any time a user swipes, taps, clicks, pinches, stretches or and zooms the screen with a finger,  when they release it an event (EVENT:Pointer) will fire.  The RTL retrieves the pointer info, ID, flags, and coordinates that were touched.  The PROP:PointerInterface allows you to specify your own optional handler of pointer events.

So how do you go about adding Touch support to a Clarion app?  Clarion developers won’t need to manually add any code to support touch. The C9 Templates will generate all the code needed to respond to touch gestures, so existing Apps will just need a regenerate with C9 to become touch-enabled.

Of course there are some UI considerations when designing your application for an optimal tablet experience. To help with that we’ll also be shipping:

  • New template “theme” that creates windows that look and feel like the Windows 8 UI
  • Touch-friendly sized buttons, menubars, etc.
  • New set of “Win8 styled” icons/images

As an example of touch-friendly design here are screen shots 3 new touch-friendly Date pickers that are already completed.

There are also some touch behavior considerations that have to be worked out.
For example defining what should happen on a Browse when its:

  • Swiped
  • Tapped
  • Clicked
  • Pinched
  • Stretched
  • Zoomed

With the input from the Clarion developer community we’ll be working on defining Browse/List behaviors, and behaviors for other controls and Template types during the beta phase of C9. Its very likely that we’ll make the behaviors Global Template settings so that you have final control as to how your application responds to touch gestures.