<< Click to Display Table of Contents >> Navigation: Available Functions > PadR() |
Syntax
PadR( <FieldName>, <NumericValue> )
Purpose
To return the characters of a field, left-justified within a character value that is <NumericValue> characters long. The resulting character value will be lengthened by adding spaces on the right to make it <NumericValue> characters long.
Parameters
<FieldName> is the name of a field, or an expression of any type.
<NumericValue> is the total length you wish the resulting character value to be.
Returns
A Character value.
Usage
The "PadR()" function may be used to left-justify text within a field of a report. Since character values are automatically left-justified within report columns, this function is mainly useful when you are combining two or more fields within a single report column. For example, if you wished to create a report column which contained the address left-justified, and the City right justified within the same report column, you could use the following expression for the report column Field Name/Expression:
.Address. + PadR( .City, 20 )
Here the numeric value of 20 would allow for City names up to nineteen characters, leaving at least a single space to separate the address from the City.