Comment Block

Purpose

Documents the functions of the Net.Data macro. Because the COMMENT block can be used anywhere in the macro, it is not documented in the other syntax diagrams.

The COMMENT block can also be used in the Net.Data initialization file.

Syntax

>>-%{---text---%}----------------------------------------------><
 

Values

text
Any string on one or more lines. Net.Data ignores the contents of all comments.

Context

Comments can be placed anywhere between Net.Data language constructs in a Net.Data macro or the Net.Data initialization file

Restrictions

Any text or characters are allowed; however, comment blocks cannot be nested.

Examples

Example 1: A basic comment block

%{
This is a comment block. It can contain any number of lines
and contain any characters. Its contents are ignored by Net.Data.
%}

Example 2: Comments in a FUNCTION block

%function(DTW_REXX) getAddress(IN  name,   %{ customer name %}
                               IN  phone,  %{ customer phone number %}
                               OUT address %{ customer address %}
                              )
{
     ....
%}

Example 3: Comments in an HTML block

%html(report) {
 
%{ run the query and save results in a table %}
@myQuery(resultTable)
 
%{ build a form to display a page of data %}
<form method="POST" action="report">
 
%{ send the table to a REXX function to send the data output %}
@displayRows(START_ROW_NUM, submit, resultTable, RPT_MAX_ROWS)
 
%{ pass START_ROW_NUM as a hidden variable to the next invocation %}
<input name="START_ROW_NUM" type="hidden" value="$(START_ROW_NUM)" />
 
%{ build the next and previous buttons %}
%if (submit == "both" || submit == "next_only")
  <input name="submit" type="submit" value="next" />
  %endif
%if (submit == "both" || submit == "prev_only")
  <input name="submit" type="submit" value="previous" />
  %endif
</form>
%}

Example 4: Comments in a DEFINE block

%define {
   START_ROW_NUM = "1"        %{ starting row number for output table %}
   RPT_MAX_ROWS = "25"        %{ maximum number of rows in the table  %}
   resultTable = %table       %{ table to hold query results          %}
%}
 

Example 5: Comments in the Net.Data initialization file

%{ changes: removed RETURN_CODE parm and DTW_DEFAULT ENVIRONMENT statement %} 
 
...
 
ENVIRONMENT (DTW_SQL) dtwsql (IN LOCATION, DB2SSID, DB2PLAN, TRANSACTION_SCOPE)
ENVIRONMENT (DTW_ODBC) odbcdll (IN LOCATION, TRANSACTION_SCOPE)
ENVIRONMENT (DTW_PERL) perldll ()
ENVIRONMENT (DTW_REXX) rexxdll ()
ENVIRONMENT (DTW_FILE) filedll ()
ENVIRONMENT (DTW_APPLET) appldll ()
ENVIRONMENT (DTW_SYSTEM) sysdll ()   


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