<< Click to Display Table of Contents >> Navigation: Available Functions > Cushion() |
Syntax
Cushion( <CharacterField> )
Purpose
To add a space between character fields when combining fields together.
Parameters
<CharacterField> can be any character field in DonorQuest.
Returns
Cushion() will return <CharacterField> with a single trailing space, if and only if there is something in <CharacterField>.
Usage
Cushion() is used to conditionally add a space character to a name or address when combining information from the various character fields in DonorQuest. A space is only added if the field to which Cushion() is applied has data.
The Cushion() function can be very useful when defining reports for which certain columns contain two or more character fields combined with the plus (+) symbol.
Example
The following expressions combine the first and last name fields together both with and without use of the Cushion() function. Notice that without the Cushion() function, the last name begins immediately after the first name:
CALL |
RESULT |
---|---|
.First_Name. |
John |
.Last_Name. |
Smith |
.First_Name. + .Last_Name. |
JohnSmith |
Cushion( .First_Name. ) + .Last_Name. |
John Smith |
Note that the following expression:
.First_Name. + " " + .Last_Name.
...would, in most cases, produce the same result as applying the Cushion() function to the first name field. However, if the first name field were to be empty for a given donor, the above expression would produce an unwanted space before the last name. The Cushion() function is smart enough to only add a space to the first name if there is indeed a first name to print.