Introduction


For the descriptions below, each function is shown as it would be called to return a value to a local variable within the script. 


All functions which return a string contain a trailing $ and are shown returning a value to str-var, a string variable.

All functions which return a numeric value do not contain a trailing $ and are shown returning a value to num-var, a numeric variable.


Note that in the macro language, there is no requirement that the data returned by a function be assigned to a local script variable before using it. For example, to check if the current Edit file has been modified, it is perfectly correct to code:

 

if Get_Modified = TRUE then ...


It does not have to be coded as:


LocalVar = Get_Modified

if LocalVar = TRUE then ...


In fact, because the Get_Modified function returns a TRUE or FALSE value already, you don't even have to compare it explicitly to TRUE or FALSE. You can use the value returned by the function directly, like this:

 

if Get_Modified then ...


This is different - and much simpler - than the IBM Rexx / ISREDIT interface, in which this technique was not available.


To illustrate, here is a simple macro that emulates a built-in command that existed in Tritus SPF:


' QMOD.MACRO

IF GET_MODIFIED THEN

   SET_MSG (OK, "DATA MODIFIED")

ELSE

   SET_MSG (OK, "DATA NOT MODIFIED")

END IF


With the * on the status line, and color-coded edit tabs, a macro to show the modified state isn't really necessary in SPFLite. It's shown here just as an example.



Detailed description of functions


Note that in the descriptions below, names like  line-ptr  are just symbolic for an actual name or expression you might use. In real code, you can't literally have variable names with minus signs in them (underscores are allowed, though).


Function operands may be either variables or expressions, providing they are of the correct type; you are not limited to just using variables. For a given function, consult the function description as to whether a particular operand should be numeric-valued or string-valued.


Operands whose descriptions end in -num or -ptr are numeric. Operands whose descriptions end in -str are strings. 


When the results of a function are not important to you, it is not necessary to assign the results to a variable; you can just call this function as a "procedure call" statement, by simply specifying the function name and its parameters on a single line, with no variable name and = equal sign preceding it.




Created with the Personal Edition of HelpNDoc: iPhone web sites made easy