IBM Books

Net.Data Reference Guide

Function call (@)

Purpose

A function call invokes a previously defined FUNCTION block with specified arguments. The function must be already defined in the Net.Data macro before you specify a function call.

Syntax

>>-@function_name--(---+----------------------------+)---------><
                       | +-,----------------------+ |
                       | V                        | |
                       +--+-variable_name------+--+-+
                          +-"--string--"-------+
                          +-variable reference-+
 

Parameters

@function_name

The name of any existing function. An alphabetic or numeric string that begins with an alphabetic character or underscore and contains any combination of alphabetic, numeric, or underscore characters.

variable name

One or more names, each additional name concatenated by a period (.). See Variable Name for syntax information.

string

Any sequence of alphabetic and numeric characters and punctuation except a tabulator, new line character, or a space.

variable reference

Returns the value of a previously defined variable and is specified with $ and (). For example: if VAR = 'abc', then $(VAR) returns the value 'abc'. See Variable Reference for syntax information. Variable references in function calls are not supported on OS/400.

Context

Can be found in these contexts:

Restrictions

Examples

Example 1: Call the SQL function formQuery.

%FUNCTION(DTW_SQL) formQuery(){
SELECT $(queryVal) from $(tableName)
%}
 
%HTML (input){
<P>Which columns of $(tableName) do you want to see?
<FORM METHOD="POST" ACTION="report">
<INPUT NAME="queryVal" TYPE="CHECKBOX" VALUE="NAME">Name
<INPUT NAME="queryVal" TYPE="CHECKBOX" VALUE="MAIL">E-mail
<INPUT NAME="queryVal" TYPE="CHECKBOX" VALUE="FAX">FAX
<INPUT TYPE="SUBMIT" VALUE="Submit request">
%}
 
%HTML (report){
<P>Here are the columns you selected:
<HR>@formQuery()
%}

Example 2: Call a REXX function with input and output parameters.

%FUNCTION(DTW_REXX) my_rexx_pgm(INOUT a, b, IN c, OUT d) {
 %EXEC{ mypgm.cmd this is a test %}
%}
%HTML(INPUT) {
 <P> Original variable values: $(w) $(x) $(z)
 <P> @my_rexx_pgm(w, x, y, z)
 <P> Modified variable values: $(w) $(x) $(z)
%}


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]