Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : $TOCPUT

$TOCPUT
Puts a line in the table of contents. (C)
Invocation
CALL $TOCPUT(section_name, spacing, numbering_yn)
 
The string that appears in the table of contents as the section name. Its syntax can be C (fixed-length character string), V (variable-length character string), or W (double-byte character).
An integer specifying the number of lines between the current table of contents entry and the next. Its syntax is B (binary) with length 2.
Prerequisites
The print arguments must be set with a call to $SETPRINT or $RESETPRINT before a call to $TOCPUT.
Usage Notes
Use $TOCPRINT to print the table of contents.
section_name cannot exceed the page width.
Four character spaces are reserved in section_name for the page number, even if it is not printed.
spacing can take on values greater than or equal to 0 and less than or equal to the page length set by $SETPRINT or $RESETPRINT.
If n is the number specified for spacing, n-1 spaces are printed. For example, if n=2, one blank line is printed between each content line.
Exceptions
 
spacing – Is zero or a negative number.
spacing – Is greater than or equal to length (where length is the page length set by $RESETPRINT or $SETPRINT).
numbering_yn – Is neither Y nor N. An empty string ('') is valid and treated as N.
Raised if the length of section_name exceeds width -4 (where width is the page width set by $SETPRINT or $RESETPRINT).
Example
The following rule builds a table of contents and prints it to the message log:

 
TOCPUT_1;
_
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ CALL $SETPRINT(10, 70, 1, 'SCR', 'N'); | 1
_ CALL $TOCPUT('SECTION ONE', 1, 'Y'); | 2
_ CALL $TOCPUT('SECTION TWO', 2, 'N'); | 3
_ CALL $TOCPUT('SECTION THREE', 1, 'Y'); | 4
_ CALL $TOCPRINT(' .'); | 5
_ ------------------------------------------------------------------------

 
Resulting Output
Pressing PF2 after executing this rule displays the following screen:

 
---------------------- INFORMATIONAL MESSAGE LOG --------------------
COMMAND ===> SCROLL ===> P
------------------------------ NEW PAGE ------------------------------
CONTENTS
========
SECTION ONE . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
SECTION TWO
SECTION THREE . . . . . . . . . . . . . . . . . . . . . . . . . . 1

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved