PS TEXT FORMAT Reference Manual
Expressions
11387 Tandem Computers Incorporated 5-21
If you omit
i-exp
or if it’s less than 1, the FIND function starts its search at
the first character position.
If
s-exp2
is an empty string, FIND returns the value of
i-exp
. (N)
JUSTIFY Function The JUSTIFY function returns a string,
s-exp1
, justified in a field.
JUSTIFY(
s-exp1
,
n-exp
[ ,
s-exp2
[ ,
s-exp3
] ] )
n-exp
specifies the width, in characters, of the field. If
n-exp
is less than
the number of characters in
s-exp1
, JUSTIFY uses the string width as the
field width to avoid truncating the string.
The optional
s-exp2
, if present, must begin with one of the letters L, C, or
R (any string will do, as long as it begins with one of those letters). It
specifies whether the justified string is to be left-justified, centered, or right-
justified in the field. If you omit this argument, the JUSTIFY function
automatically right-justifies the string.
The optional
s-exp3
specifies a “pad” string used to fill the remainder of
the field. If you omit this argument, the JUSTIFY function pads the field
with blanks. JUSTIFY repeats the pad string as many times as is necessary
to fill the field, using as many of the leftmost characters of the pad as it can
when an entire repetition of the pad won’t fit. For example:
\(JUSTIFY("BAM",24,"center","thud"\)
returns the field
thudthudthBAMthudthudthu
If it’s impossible to center the string exactly in the field, JUSTIFY chooses to
offset it one character to the left, rather than one character to the right.