11. Report-Writer Expressions and Formats : Format Specifications : Character String Format C
 
Share this page                  
Character String Format C
Use the C format to print string expressions.
The syntax of the C format specification is:
[-|*|+] c[f|j]n[.w]
where:
f
Instructs Report-Writer to fold (wrap) text by breaking between words when printing strings that span multiple lines. Tab and carriage return characters produce tab and carriage return actions within the string. Must be specified in conjunction with either w and/or n.
j
Instructs Report-Writer to fold (wrap) text by breaking between words, and to right justify text by padding the line with blanks between words, when printing strings that span multiple lines. Tab and carriage return characters produce tab and carriage return actions within the string. Must be specified in conjunction with either w and/or n.
n
Specifies the maximum number of characters to print. If there are more than n characters in the string, it truncates the excess. If there are fewer, it pads the rest of the string with blanks until n characters have been printed. Use a value of 0 for n if the entire string is to be printed, regardless of its length.
w
Specifies the number of characters to print on each line. If n is greater than w, then more than one line is written, in newspaper-style column format. By default, w is set to n.
When specifying the previous options, you can use either uppercase or lowercase letters interchangeably. The optional field width n can be specified to give an exact width. If n is specified and the character string is less than n characters wide, blanks are added to the output to assure n characters. If the string is longer than n characters, only the leftmost n characters are printed and the rest are ignored.
If you specify a value for w as well as n, you can print text in column format (that is, newspaper style). The f and j modifiers can be used to assure breaking of words at blanks, or right justification of text. If neither is specified, simple wrap-around of text occurs, regardless of where the line break might occur.
Report-Writer has a default maximum of 310 lines for printing a character string. If you exceed this maximum, some of the text can not appear in your report. You can override the default by specifying the -wmxwrap parameter on the command line.
If you use the C format statement, the following unprintable characters are printed as spaces:
Horizontal tab
Vertical tab
Line feed
Form feed
Carriage return
Note that tabs and carriage returns cause tabs and carriage return actions if you are using multi-line formats, such as cf or cj.
To print a visual representation of unprintable characters, use the T format statement (see page Character String Format T).