Defining SDC functions

A function definition contains a list of SDC statements that provide setup and formatting information that is to be sent to an ADSI telephone. This list can be a combination of any of the SDC functions that are listed in ADSI script statements.

The syntax of a function definition is:

function function_name parm 1 ... parm n
{
      statement 1;
      ...
      statement n;
}

where:

function_name
The name of the function. This must be an ASCII value that is unique in the file. It can have a maximum of 20 characters. It cannot have embedded blank characters.
parm 1 ... parm n
Optional parameters that can be substituted in some of the following statements. Parameter names can be the same for different functions. They are alphanumeric strings, up to 20 characters in length. They cannot have embedded blank characters.
statement 1 ... statement n
A list of SDC function statements that define the data that is to be sent to the ADSI telephone.

You must send the parameters parm 1 ... parm n to an ADSI state table. You must prefix the parameter names with the dollar ($) character when you use them in the SDC statements.

You must separate the parameters by at least one blank character; for example:

load_virtual_display 1 "DAY= $day : MONTH=$month"
Note: Not all SDC statements allow parameters to be substituted. See the statement descriptions in ADSI script statements to find out which statements have this capability.

For more information, see function.

Here is an example of an SDC function statement:

function menu day month year
{
      load_soft_key_table 2 enter;
      load_virtual_display 1 "$day";
      load_virtual_display 2 "$month";
      load_virtual_display 3 "$year";
}

In this example, you must concatenate the parameters day, month, and year into a single string before you use the ADSI state table. You can do this by using the ADSI_Parameters state table (see ADSI_Parameters). The existing values of the parameters day, month, and year appear on the first three lines of the ADSI telephone display when this function is sent to the telephone.