IBM Books

Net.Data Reference Guide


Table Functions

These functions simplify working with Net.Data tables and are more efficient than writing your own functions using REXX, C, or PERL. These functions are all used in the sample macro tbtest.mac, which come with the Net.Data tools package.

DTW_TB_DLIST

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns an HTML definition list from a macro table.

Syntax

Parameters

Table 40. DTW_TB_DLIST Parameters
Data Type Parameter Use Description
array table IN A symbol specifying the macro table variable to output as an HTML definition list.
integer term IN The column number in table containing term name values (the text to go after the<DT> tag). The default is to use the first column.
integer def IN The column number in table containing term definition values (the text to go after the <DD> tag). The default is to use the second column.
string termstyle IN A variable or literal string containing a list of HTML elements for the term name values. The default is to use no style tags.
string defstyle IN A variable or literal string containing a list of HTML elements for the term definition values. The default is to use no style tags.
string anchor IN Specifies for which HTML elements an anchor reference is generated. Valid values are DT and DD. The default is to not generate anchor references.
integer anchor_u IN The column number in table that contains the URLs for the anchor references. The default is not to generate anchor references.
string image IN Specifies for which HTML elements an inline image is generated. Valid values are DT and DD. The default is to not generate inline images.
integer image_u IN The column number in table that contains the URLs for the inline images. The default is not to generate inline images.

Examples

@DTW_TB_DLIST(Mytable,"3","4","b i","strong","DD","2","DT","1")
@DTW_TB_DLIST(Mytable,"","4","b","strong","DT","2","DT","1")
@DTW_TB_DLIST(Mytable,"3","4","","","DT","2")
@DTW_TB_DLIST(Mytable,"","","i","b","DD","2","DT","1")
@DTW_TB_DLIST(Mytable,"","3","","","DD","2","DT","1")
@DTW_TB_DLIST(Mytable,"3","4","EM","B U I","DT","2","DT","1")
@DTW_TB_DLIST(Mytable,"","4","","","DD","2","DT","1")
@DTW_TB_DLIST(Mytable,"3","","I","I","DT","2","DD","1")

Example 1: The HTML generated for the first example looks similar this, depending on the table data.

<DL>
<DT>
<IMG SRC="http://www.mycompany.com/images/image1.gif" ALT=""><b><i>image1text</i></b>
<DD>
<A HREF="http://www.mycompany.com/anchor1.html"><strong>anchor1text</strong></A>
<DT>
<IMG SRC="http://www.mycompany.com/images/image2.gif" ALT=""><b><i>image2text</i></b>
<DD>
<A HREF="http://www.mycompany.com/anchor2.html"><strong>anchor2text</strong></A>
<DT>
<IMG SRC="http://www.mycompany.com/images/image3.gif" ALT=""><b><i>image3text</i></b>
<DD>
<A HREF="http://www.mycompany.com/anchor3.html"><strong>anchor3text</strong></A>
<DT>
<IMG SRC="http://www.mycompany.com/images/image4.gif" ALT=""><b><i>image4text</i></b>
<DD>
<A HREF="http://www.mycompany.com/anchor4.html"><strong>anchor4text</strong></A>
</DT>
</DL>

DTW_TB_DUMPH

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns the contents of a macro table variable. Each row of the table is displayed on a different line. The entire table is enclosed in <PRE></PRE> tags.

Syntax

Parameters

Table 41. DTW_TB_DUMPH Parameters
Data Type Parameter Use Description
array table IN A symbol specifying the macro table variable to output.

Examples

Example 1:

@DTW_TB_DUMPH(Mytable)

The HTML generated by this example looks like this:

<PRE>
Name             Department              Position
Jack Smith       Internet Technologies   Software Engineer
Helen Williams   Database                Development Manager
Alex Jones       Manufacturing           Industrial Engineer
Tom Baker        Procurement             Sales Rep
</PRE>

DTW_TB_DUMPV

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns the contents of a macro table variable. Each row is on a different line. The entire table is enclosed in <PRE></PRE> tags.

Syntax

Parameters

Table 42. DTW_TB_DUMPV Parameters
Data Type Parameter Use Description
array table IN A symbol specifying the macro table variable to output.

Examples

Example 1:

@DTW_TB_DUMPV(Mytable)
The HTML generated for this example looks like this:
<PRE>
http://www.mycompany.com/images/image1.gif
http://www.mycompany.com/anchor1.html
image1text
anchor1text
http://www.mycompany.com/images/image2.gif
http://www.mycompany.com/anchor2.html
image2text
anchor2text
http://www.mycompany.com/images/image3.gif
http://www.mycompany.com/anchor3.html
image3text
anchor3text
http://www.mycompany.com/images/image4.gif
http://www.mycompany.com/anchor4.html
image4text
anchor4text
</PRE>

DTW_TB_HTMLENCODE

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns the input macro table with these HTML characters encoded:
Ampersand & &#38;
Double quote " &#34;
Greater than > &#62;
Less than < &#60;

Syntax

Parameters

Table 43. DTW_TB_HTMLENCODE Parameters
Data Type Parameter Use Description
array table INOUT The macro table variable to modify.
string collist IN The column numbers in table to encode. The default is to encode all columns.

Examples

Example 1:

@DTW_TB_HTMLENCODE(Mytable, "3 4")
The special characters in columns 3 and 4 of the specified table are replaced with their encoded forms.

DTW_TB_INPUT_CHECKBOX

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns one or more HTML checkbox input tags from a macro table variable.

Syntax

Parameters

Table 44. DTW_TB_INPUT_CHECKBOX Parameters
Data Type Parameter Use Description
array table IN The macro table variable to display as checkbox input tags.
string prompt IN The column number in table or a string containing the text to display next to the checkbox. This parameter is required, but can have a null ("") value. When null, the value used is the value defined for namecol.
string namecol IN The column number in table or a string containing the input field names.
string valuecol IN The column number in table or a string containing the input field values. The default is 1.
string rows IN The list of rows in table from which to generate the input fields. The default is to use all rows.
integer checkedrows IN The list of rows specifying which rows of table to check. The default is to not check fields.

Examples

@DTW_TB_INPUT_CHECKBOX(Mytable,"","5")
@DTW_TB_INPUT_CHECKBOX(Mytable,"3","5")
@DTW_TB_INPUT_CHECKBOX(Mytable,"3","5","4")
@DTW_TB_INPUT_CHECKBOX(Mytable,"3","5","","2 5")
@DTW_TB_INPUT_CHECKBOX(Mytable,"3","4","","2 3 4","1 3 4")

The HTML generated for the last exmple looks like this:

<INPUT TYPE="CHECKBOX" NAME="anchor2text" VALUE="1">image2text<BR>
<INPUT TYPE="CHECKBOX" NAME="anchor3text" VALUE="1" CHECKED>image3text<BR>
<INPUT TYPE="CHECKBOX" NAME="anchor4text" VALUE="1" CHECKED>image4text<BR>

DTW_TB_INPUT_RADIO

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns one or more HTML radio input tags from a macro table variable.

Syntax

Parameters

Table 45. DTW_TB_INPUT_RADIO Parameters
Data Type Parameter Use Description
array table IN The macro table variable to display as radio input tags.
string prompt IN The column number in table or a string containing the text to display next to the radio button. Required parameter, but can contain an null ("") value. When null, uses the value of valuecol.
string namecol IN The column number in table or a string containing the input field names.
string valuecol IN The column number in table or a string containing the input field values.
string rows IN The list of rows in table from which to generate the input fields. The default is to use all rows.
integer checkedrows IN A row number in table to display the corresponding radio button as checked. Only one value is allowed.

Examples

@DTW_TB_INPUT_RADIO(Mytable,"","Radio1","5")
@DTW_TB_INPUT_RADIO(Mytable,"3","Radio2","3")
@DTW_TB_INPUT_RADIO(Mytable,"3","Radio3","4")
@DTW_TB_INPUT_RADIO(Mytable,"3","Radio4","4","2 3 4","4")

The HTML generated for the last example looks like this:

<INPUT TYPE="RADIO" NAME="Radio4" VALUE="anchor2text">image2text<BR>
<INPUT TYPE="RADIO" NAME="Radio4" VALUE="anchor3text">image3text<BR>
<INPUT TYPE="RADIO" NAME="Radio4" VALUE="anchor4text" CHECKED>image4text<BR>

DTW_TB_INPUT_TEXT

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns one or more input text tags from a Net.Data macro TABLE variable.

Syntax

Parameters

Table 46. DTW_TB_INPUT_TEXT Parameters
Data Type Parameter Use Description
array table IN The macro TABLE variable to display as text input tags.
string prompt IN The column number in table or a string containing the text to display next to the input field. If a null ("") value is displayed, no text is displayed.
string namecol IN The column number in table or a string containing the input field names.
string valuecol IN The column number in table or a string containing the default input field values, which is specified for the VALUE attribute. The default is to not generate the VALUE attribute value.
integer size IN The number of characters of the input field, which is specified for the SIZE attribute. The default is the length of the longest default input value, or 10 if there is no default input.
integer maxlen IN The maximum length of an input string, which is specified for the MAXLEN attribute. The default is to not generate the MAXLENGTH attribute value.
integer rows IN The list of rows in table from which to generate the input fields. The default is to use all rows.

Examples

@DTW_TB_INPUT_TEXT(Mytable,"","5")
@DTW_TB_INPUT_TEXT(Mytable,"","5","4")
@DTW_TB_INPUT_TEXT(Mytable,"Enter title:","5","4")
@DTW_TB_INPUT_TEXT(Mytable,"3","5","4")
@DTW_TB_INPUT_TEXT(Mytable,"3","5","4","30")
@DTW_TB_INPUT_TEXT(Mytable,"3","5","4","35","40")
@DTW_TB_INPUT_TEXT(Mytable,"3","3","4","35","40","1 2 3")

The HTML generated for the last example looks like this:

<P>image1text
<INPUT TYPE="TEXT" NAME="image1text" VALUE="anchor1text" SIZE="35" MAXLENGTH="40">
<P>image2text
<INPUT TYPE="TEXT" NAME="image2text" VALUE="anchor2text" SIZE="35" MAXLENGTH="40">
<P>image3text
<INPUT TYPE="TEXT" NAME="image3text" VALUE="anchor3text" SIZE="35" MAXLENGTH="40">

DTW_TB_LIST

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns an HTML list.

Syntax

Parameters

Table 47. DTW_TB_LIST Parameters
Data Type Parameter Use Description
array table IN A symbol specifying the macro table variable to output as an HTML list.
string listtype IN The type of list to generate. Acceptable values include:

  • DIR

  • MENU

  • OL

  • UL
integer listitem IN The column number in table containing the list values (the text to go after the <LI> tag). The default is to use the first column.
string itemstyle IN A variable or literal string containing a list of HTML elements for the term name values. The default is to use no style tags.
integer anchor_u IN The column number in table that contains the URLs for the anchor references. If this value is not specified, no anchor references are generated.
integer image_u IN The column number in table that contains the URLs for the inline images. If this value is not specified, no inline images are generated.

Examples

@DTW_TB_LIST(Mytable,"MENU")
@DTW_TB_LIST(Mytable,"MENU","3")
@DTW_TB_LIST(Mytable,"UL","3","","2")
@DTW_TB_LIST(Mytable,"UL","4","B","2","1")
@DTW_TB_LIST(Mytable,"DIR","3","b i")
@DTW_TB_LIST(Mytable,"OL","4","TT", "U","2","1")

The HTML generated for the last example looks like this:

<TT><U>
<OL>
<LI><A HREF="http://www.mycompany.com/anchor1.html">
<IMG SRC="http://www.mycompany.com/images/image1.gif" ALT="">anchor1text</A>
<LI><A HREF="http://www.mycompany.com/anchor2.html">
<IMG SRC="http://www.mycompany.com/images/image2.gif" ALT="">anchor2text</A>
<LI><A HREF="http://www.mycompany.com/anchor3.html">
<IMG SRC="http://www.mycompany.com/images/image3.gif" ALT="">anchor3text</A>
<LI><A HREF="http://www.mycompany.com/anchor4.html">
<IMG SRC="http://www.mycompany.com/images/image4.gif" ALT="">anchor4txt</A>
</OL>
</U></TT>

DTW_TB_SELECT

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns an HTML SELECT menu.

Syntax

Parameters

Table 48. DTW_TB_SELECT Parameters
Data Type Parameter Use Description
array table IN The macro table variable to display as a SELECT field.
string name IN The value of the NAME attribute of the SELECT field.
integer optioncol IN The column number in table with values to use in the OPTION tags of the SELECT field. The default is to use the first column.
integer size IN The number of rows in table to use for OPTION tags in the SELECT field. The default is to use all the rows.
string multiple IN Specifies whether multiple selections are allowed. The default is N, which does not allow multiple selections.
string selectedrows IN The rows from the table to use in the select field. The default is to use all the rows.
string rows IN The list of rows from table whose OPTION tags are checked. To specify more than one row, you must have the multiple parameter set to Y. The default is to select the first item.

Examples

@DTW_TB_SELECT(Mytable,"URL0")
@DTW_TB_SELECT(Mytable,"URL1","3")
@DTW_TB_SELECT(Mytable,"URL1","3","9")
@DTW_TB_SELECT(Mytable,"URL3","3","","y")
@DTW_TB_SELECT(Mytable,"URL4","2","3","y","2 4")
@DTW_TB_SELECT(Mytable,"URL5","3","","y","","2 5")
@DTW_TB_SELECT(Mytable,"URL6","3","","y","1 2 4","1 4")

The HTML generated for the last example looks like this:

<SELECT NAME="URL6" SIZE="3" MULTIPLE>
<OPTION SELECTED>image1text
<OPTION>image2text
<OPTION>image4text
</SELECT>

DTW_TB_TABLE

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns an HTML table from a macro table variable.

Syntax

Parameters

Table 49. DTW_TB_TABLE Parameters
Data Type Parameter Use Description
array table IN A macro table variable to output as an HTML table.
string options IN The table attributes inside the TABLE tag. The default is to use no attributes. Valid values include:

  • BORDER

  • CELLSPACING

  • WIDTH
string collist IN The column numbers in table to use in the HTML table. The default is to us all the columns.
string cellstyle IN A list of HTML style elements, such as B and I, to go around text in each TD tag. The default is not to use style tags.
integer anchor_u IN The column number in table containing URLs used to create anchor references. You must specify the column in collist also. The default is to not generate anchor reference tags.
integer image_u IN The column number in table containing URLs used to create inline images. You must specify the column in collist also. The default is to not generate image tags.
integer url_text IN The column number in table containing text to display for anchor references or inline images. The default is to use the URL itself.
string url_style IN A list of HTML style elements for the text specified in url_text. The default is not to generate style tags.

Examples

@DTW_TB_TABLE(Mytable,"BORDER","4 2 1","i","2","1","4","b")
@DTW_TB_TABLE(Mytable)
@DTW_TB_TABLE(Mytable,"BORDER")
@DTW_TB_TABLE(Mytable,"","3 4")
@DTW_TB_TABLE(Mytable,"BORDER","2 3 4","em")

The HTML generated for the first example looks like this:

<TABLE BORDER>
<TR>
<TH>TITLE
<TH>ANCHORURL
<TH>IMAGEURL
<TR>
<TD><i>anchor1text</i>
<TD><A HREF="http://www.mycompany.com/anchor1.html"><b>anchor1text</b></A>
<TD><IMG SRC="http://www.mycompany.com/images/image1.gif" ALT=""><b>anchor1text</b>
<TR>
<TD><i>anchor2text</i>
<TD><A HREF="http://www.mycompany.com/anchor2.html"><b>anchor2text</b></A>
<TD><IMG SRC="http://www.mycompany.com/images/image2.gif" ALT=""><b>anchor2text</b>
<TR>
<TD><i>anchor3text</i>
<TD><A HREF="http://www.mycompany.com/anchor3.html"><b>anchor3text</b></A>
<TD><IMG SRC="http://www.mycompany.com/images/image3.gif" ALT=""><b>anchor3text</b>
</TABLE>

DTW_TB_TEXTAREA

Purpose


AIX HP-UX OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X

Returns HTML TEXTAREA tags from a macro table variable.

Syntax

Parameters

Table 50. DTW_TB_TEXTAREA Parameters
Data Type Parameter Use Description
array table IN A macro table variable to show as a TEXTAREA tag
string name IN The name of the text area.
integer numrows IN The number of rows to display. The default is the number of rows in table.
integer numcols IN The number of columns to display. The default is the length of the longest row in table.
integer valuecol IN The column number in table whose values are shown in the text area. The default is the first column.
string rows IN A list of rows in table used to generate the TEXTAREA tag. The default is to use all rows.

Examples

@DTW_TB_TEXTAREA(Mytable,"textarea1")
@DTW_TB_TEXTAREA(Mytable,"textarea2","3")
@DTW_TB_TEXTAREA(Mytable,"textarea3","3","40")
@DTW_TB_TEXTAREA(Mytable,"textarea4","2","80","3")
@DTW_TB_TEXTAREA(Mytable,"textarea5","3","70","4","1 3 4")

The HTML generated for the last example looks like this:

<TEXTAREA NAME="textarea5" ROWS="3" COLS="70">
anchor1text
anchor3text
anchor4text
<TEXTAREA>


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