JUSTIFY

Returns a string justified within a specified number of characters.

Syntax

JUSTIFY(string,[how,width,pad])

Arguments

Argument Description Default
string The string to justify. None
[how] One of the following: L
L Left-justify string.
R Right-justify string.
C Center string.
[width] The total width, in the range 1 to 255 characters, of the return. 10
[pad] A single character used to pad the return to width. '' (blank)

Results

Result Description
Return Contents of string padded and justified as appropriate.
%%RC One of the following:
-1 width is invalid.
0 No error.
1 string is larger than width.
%%RM A null string ('').
%%RV The number of characters in the return.

Examples

Function Call Return %%RC %%RV
JUSTIFY('Total',C,12,'_') '____Total___' 0 12
JUSTIFY('Total',R,12,' ') ' Total' 0 12
JUSTIFY('Total amount due',C,12,'_') 'Total amount due' 1 16