Invoking an External Application API by Using the UFUNC.C Interface

You can extend the SQR language by adding user functions that are written in standard languages, such as C. This feature enables you to integrate your own code and third-party libraries into SQR. For example, suppose that you have a library for communication over a serial line, with functions for initiating the connection and sending and receiving data. SQR enables you to call these functions from SQR programs.

To extend SQR in this way, you must prepare the functions, specify them to SQR, and then link the objects (and libraries) with the SQR objects and libraries to form a new SQR executable. The new SQR executable then recognizes the new functions as if they were standard SQR functions.

One example of such an extension would be an initcap function. Oracle users are familiar with this function. The initcap function changes the first letter of every word to uppercase and changes the rest of the letters to lowercase. The result value in the following code example would be Mr. Joseph Jefferson:

let $a = initcap('MR. JOSEPH JEFFERSON')