CC: Difference between revisions
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
ABC | ABC | ||
C for centered is a [[Attribute (Screen)#Control | C for centered is a [[Attribute (Screen)#Control Attributes|Control Attribute]] | ||
<noinclude> | <noinclude> | ||
[[Category:Format Specifications]] | [[Category:Format Specifications]] | ||
</noinclude> | </noinclude> |
Revision as of 14:54, 7 August 2013
The CC (character, centered) format specification identifies string data that is to be centered upon output. It can be used for both types of FORM statements and with the full screen processing statements.
- Input characteristics
When CC is used for input, it is treated the same as C is on input. (See C Format Specification for more information.)
- Output characteristics
When CC is used for output, Business Rules all leading and trailing spaces, then evenly pads spaces to the left and the right of the value according to the amount specified as the field length. If field length is not specified, the default field length is the length of the string (including spaces); CC centers the value within this amount.
The following example will center the text on the second line of the screen:
01000 PRINT FIELDS "2,1,CC 80": "Payroll"
When padding of an odd number of characters is required (such as when a value with an even number of characters is centered in a field with an odd-numbered field length); extra padding goes to the right. NOTE the following example:
00050 PRINT USING "FORM CC 6": "ABCD" 00060 PRINT USING "FORM CC 6": "ABC"
The output from the above lines would look as follows:
ABCD ABC
C for centered is a Control Attribute