What's new in KCML 6.10


Records

A simple method of defining fields in a structure or records has been implemented using DEFRECORD and FLD. This allows the fields to be laid out in a natural way and relieves the programmer from having to compute start bytes and the total size of the structure. KCML will track the records fields and not allow them to be altered or reused. The records in a library can be browsed in the Workbench. Some standard KCML structures are documented in the manual using records (see $PSTAT, LINPUT+ and KI_INFO).

Fields

Fields have been changed considerably internally to be more efficient and flexible. A new naming scheme for fields has been introduced to permit a simple standardized data-typing for the data aware types. If these new types are used in defining the fields that represent KDB table rows then the Type$ property, which redundantly specifies the datatype of a column, can be dispensed with. In particular there are new field packing types for DATE, TIME, HEX and BOOL. There are, in fact, two boolean types, an MB type for legacy Y/N booleans returning a string value and a new BOOL type that encodes Y/N to be compatible but returns a numeric TRUE or FALSE.

A TIMESTAMP type can be used for millisecond timestamps. The SY8 type used to encode numbers using the KCML number format has been renamed to FP.

The PACK() function returns the packing format used for a field using the new naming scheme. The DIM() function will return the occurrence number for a field, if any.

There may be compatibility issues with KI_DESCRIBE_COL as it will now return the new pack codes rather than the two character hex strings that previous versions of KCML would have done.

The $UNPACK format for counting bits HEX(FBxxxxxx) is now only available through $UNPACK(E="BITS(xxxxxx)"). The Informix money format HEX(FCxx) is also now only available as an extended $PACK(E="X").

Constants

KCML will now supply default values for certain common constants. The available constants are listed in the KCML workbench functions browser and on this page.

Constants are now enabled by default i.e. the default value of byte 59 in $OPTIONS RUN is now HEX(01)

Modules or Libraries

Note the term module was replaced with library in KCML 6.20. This document refers to libraries for consistency.

Variables defined as common in COM statements within a library will be automatically instantiated in the foreground when the library is loaded. They are known as library variables. Constants and fields are ignored for this but will be copied to the foreground if referenced in executing code. Variables declared in DIM statements in the library are ignored. Library variables are not destroyed if a library is unloaded though this may be supported in a future version of KCML.

Libraries can have constructor DEFSUBs with the special reserved name of '_Constructor() which will be called automatically by LIBRARY ADD when a library is loaded.

New keywords PUBLIC and PRIVATE can be applied to DEFSUB in a library to indicate whether the function is visible from outside the library. By default a DEFSUB without this modifier is considered as PUBLIC.

A new make utility, kmake, can be used to compile libraries in a batch mode. Libraries can be comprised of more than one program whose line number ranges may clash as the compiler will renumber them automatically. The utility will compile only those libraries with components which have been modified since the library was last built. Each program can have its own constructor DEFSUB and the compiler will rename them uniquely and arrange for them to be called in turn when the library is loaded. The make utility is driven by an XML build script listing the libraries and their components.

XML DOM

Support for the Apache Xerces XML DOM has been provided through a new type of dynamic object. The Document Object Model is a W3C standard and allows programmers to directly manipulate XML documents in memory in a natural way.

There is also a SAX2 implementation which streams the text and does not build any tree structures. This should be more efficient for large documents.

The Apache Xerces DLL or shared library, plus a KCML shim library dyndom.dll, must be available on the server. Versions for NT, Linux, Solaris, Unixware, AIX and HP-UX are available on kcml.com.

KCML workbench

A number of small changes have been made to the KCML workbench.

SOAP

SOAP support, for both client and server, has been enhanced beyond that provided in KCML 6.00 mostly to track the WSDL standard and the emerging Microsoft .Net implementation. Some of these changes to the KCML SOAP server are not backward compatible (e.g. the arguments to the KCMLObjectExports $DECLARE). The use of a WSDL file is now mandatory but KCML can generate it automatically and in particular can return it in response to a HTTP GET request. The URL used to access the WSDL must now conform to a .Net convention of ending in ?WSDL. If the endpoint URL is accessed from a browser a KCML SOAP server will now generate a documentation page. The SOAP client can now understand the WSDL generated by a .Net Web Service.

KCMLObjectGetUserName() can be used to authenticate users in a SOAP server.

The object browser in the KCML workbench can now remember SOAP WSDL URLs and permits the browsing of their methods without the requirement to have a running instance in the application. By right clicking a SOAP reference in the browser a suitable CREATE statement or a method invocation can be pasted into the editor window.

COM

The object browser in the KCML workbench can now remember COM type library references and permits the browsing of their properties, methods and events without the requirement to have a running instance in the application. By right clicking a COM reference in the browser a suitable CREATE statement or a method invocation can be copied to the clipboard to be pasted into the editor window.

There is specific support for the Win32 type library which defines all the Win32 API in the form of a COM type library. A right click here can copy a suitable $DECLARE to invoke a function to the clipboard.

KDB database

Unicode

The default encoding for KCML and Kclient has been changed from Latin-1 to the UTF-8 encoding of Unicode. For English speaking countries this will have no implications but in countries and languages which require the use of characters above 0x80 there may well be issues. See the Unicode tutorial in the manual.

The implementation of UTF-8 is intended for forms based applications. It is incompatible with text applications that use $BOXTABLE and applications that run on terminals other than KClient using TERMINFO.

KCML will use UTF-8 in communicating with the client if the environment variable USING_UTF8 is set.

There are new $PACK formats to support converting from UTF-8 to the native locale of the server.

There are new functions to get the number of characters in a Unicode string (ULEN8()) and to move one character at a time forwards (UNEXT8()) and backwards (UPREV8()) in a string.

The POS(), VER(), $UPPER, $LOWER and $TRAN functions support the use of UTF-8 encoded characters.

The graphical forms designer Kform now requires an operating system that supports Unicode like NT4, Windows 2000 or XP. It does not run on Windows 9x. Kclient is available in two versions, for NT class operating systems that support Unicode and for Windows 9x type operating systems that do not.

Oracle

There is a new Oracle layer for the KDB database which targets Oracle 9i and completely implements the functionality of KDB in a totally transparent way.

The older shared library for Oracle 8 is still available but will no longer be maintained.

Forms

New methods

New styles

Connection manager

Other changes