WebAccess provides many built-in functions you can use to cause special processing to occur. A function cannot appear in a template alone, but must serve as a parameter of a keyword, part of an expression that is a parameter of a keyword, or a parameter of another function. Function names are case sensitive.
Functions usually appear within a SET, STRING, or VAR keyword. The following example uses the substring function as the parameter of the VAR keyword.
{SET TisATest="this is a test"} {VAR substring(TisATest, 8, 6)} {! output: "a test"}
You need to be aware of the following rules concerning functions:
If a function is used in an expression, the expression must be enclosed in parentheses:
{SET tomorrow = (today() + 86400000)}
Expressions used as function parameters must be enclosed in parentheses:
{SET curDay = today()} Tomorrow is {VAR date((curDay + 86400000), {STRING fullDate})}
Functions can serve as parameters to other functions:
{VAR date(today(), {STRING fullDate})}
Variables and names of strings in string tables cannot have the name of a function. For more information about string tables see Section 4.16, STRINGTABLE.
{SET date = today()} {! Illegal. date is the name of a function. }
This document describes the following template functions and their syntax, parameters, and return values: