#set TITLE = "functions"
#include top

.SH Available functions
.LP
#set FILE = "functions.html#arithmetic"
#set TAG = arithmetic
#include link
.br
#set FILE = "functions.html#strings"
#set TAG = strings
#include link
.br
#set FILE = "functions.html#commalists"
#set TAG = commalists
#include link
.br
#set FILE = "shell.html"
#set TAG = shell command processing
#include link
.br
#set FILE = "sql.html"
#set TAG = sql result processing
#include link
.br
#set FILE = "functions.html#html"
#set TAG = HTML formatting
#include link
.br
#set FILE = "functions.html#dates"
#set TAG = dates
#include link
.br
#set FILE = "functions.html#times"
#set TAG = times
#include link
.br

#include space

.SH How to use functions
.LP
Functions usually take one or more arguments and return a value.
Functions may be used with \fC#set\fR, \fC#if\fR, \fC#elseif\fR, \fC#while\fR or \fC#call\fR.
Examples:
.nf
\0#call $setdatefmt( "yyyy/mm/dd" )
\0
\0#set prefix = $substring( @@filename, 1, 3 )\fR
\0
\0#set email = $change( " ", "_", @@email )\fR
\0
\0#if $isnumber(@@A) = 1 && @@A != 0
\0   #set C = $arith( @@B/@@A )
\0#endif
.fi

#include space
.SH #call
\fC#call\fR may be used to invoke a function when no return value is to be collected.
.br
Example: \fC#call $setdatefmt( "yyyy/mm/dd" )\fR

#include space
.SH Function syntax
Function names always begin with a dollar sign.  Passed parameters are separated by 
a comma and optionally, whitespace.  The parser is not strict about use of quotes but 
they are required for constants that contain embedded whitespace or comma.  
Some functions accept a variable number of arguments.
Function calls cannot be nested.

#include space
.SH Adding custom functions
Custom functions may easily be added to the file \fCcustom.c\fR.
That file contains further instructions.

#include bottom
