CC: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(Created page with "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 ...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
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:
;Input characteristics:
Line 19: Line 19:
  ABCD
  ABCD
  ABC
  ABC
C for centered is a [[Attribute (Screen)#Control Attributes|Control Attribute]]


<noinclude>
<noinclude>
[[Category:Format Specifications]]
[[Category:Format Specifications]]
</noinclude>
</noinclude>

Latest revision as of 20:12, 10 October 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