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


Chapter 3 Tools : $SETTITLE

$SETTITLE
Sets a title or footer to be printed on subsequent pages of output. (C)
Invocation
CALL $SETTITLE(line_number, left_string, center_string, right_string)
 
A character string specifying the string to be printed flush left. Its syntax can be C (fixed-length character string), V (variable-length character string), or W (double-byte character).
A character string specifying the string to be centered (based on the center of the page). Its syntax can be C, V, or W.
Prerequisites
The print arguments must be previously set with a call to $SETPRINT or $RESETPRINT before a call to $SETTITLE.
Usage Notes
$PRINTLINE must be called after $SETTITLE is called, to print the title/header of the page.
If line_number is positive, a title is printed. If it is negative, a footer is printed. If it is 0, an exception is raised.
The magnitude of line_number can be greater than or equal to 1 and less than or equal to length -1 (where length is the page length specified using the $SETPRINT or $RESETPRINT).
All three arguments must be given. If a particular title is not to be printed, replace either left_string, center_string, or right_string with a null string (‘ ’).

Exceptions
 
Raised when the value provided for line_number is zero (0).
Raised if the call is not preceded by a call to $RESETPRINT or $SETPRINT, or if the number of title lines and the number of footing lines add up to be greater than or equal to either length - 1 (where length is the page length specified by $SETPRINT or $RESETPRINT) or 29, whichever is less.
Raised if the combined length of the character strings exceeds width (where width is the page width specified by $SETPRINT or $RESETPRINT) or 132, whichever is less; or if the length of the left or right character strings (left_string or right_string) is such that the center string (center_string) cannot be centered.
Example
The following rule prints a page to the message log using the default title, sets new titles with a call to $SETTITLE, forces a page break so that the new titles are in effect, and prints a page using the new titles:

 
SETTITLE_1;
_
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ CALL $SETPRINT(10, 70, 1, 'SCR', 'N'); | 1
_ CALL $PRINTLINE('THIS PAGE HAS THE DEFAULT TITLES'); | 2
_ CALL $SETTITLE(1, 'LEFT TITLE', 'CENTER TITLE', | 3
_ 'RIGHT TITLE'); |
_ CALL $NEWPAGE; | 4
_ CALL $PRINTLINE('THIS PAGE HAS THE NEW TITLES'); | 5
_ ------------------------------------------------------------------------

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

 
---------------------- INFORMATIONAL MESSAGE LOG ---------------------
COMMAND ===> SCROLL ===> P
------------------------------ NEW PAGE ------------------------------
Page 1
THIS PAGE HAS THE DEFAULT TITLES
------------------------------ NEW PAGE ------------------------------
Page 2
LEFT TITLE CENTER TITLE RIGHT TITLE
THIS PAGE HAS THE NEW TITLES

 

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