How to: |
The CTRFLD function centers a character string within a field. The number of leading spaces is equal to or one less than the number of trailing spaces.
CTRFLD is useful for centering the contents of a field and its report column, or a heading that consists only of an embedded field. HEADING CENTER centers each field value including trailing spaces. To center the field value without the trailing spaces, first center the value within the field using CTRFLD.
CTRFLD(source_string, length, output_format)
where:
Alphanumeric
Is the alphanumeric constant enclosed in single quotation marks, or a field or variable that contains the character string.
Integer
Is the number of characters in the source_string and the output_format. This argument must be greater than 0. A length less than 0 can cause unpredictable results.
Alphanumeric
CTRFLD centers LAST_NAME and stores the result in a column with the format A12:
CTRFLD(LAST_NAME, 12, 'A12')
iWay Software |