78. Complete Address
Description
Format a complete multi-line or single-line address.
Code
Multi-line:
""
IF ANSWERED( FirmName )
"«Firm Name»
"
END IF
RESULT + "«Street1»
"
IF ANSWERED( Street2 )
RESULT + "«Street2»
"
END IF
RESULT + "«City», «State» «Zip»"
Single-line:
""
IF ANSWERED( FirmName )
"«Firm Name», "
END IF
RESULT + "«Street1», "
IF ANSWERED( Street2 )
RESULT + "«Street2», "
END IF
RESULT + "«City», «State» «Zip»"
Explanation
This computation takes the address elements FirmName, Street1, Street2, City, State, and Zip and assembles them into a complete address. The first example creates a multi-line address like this:
Acme Consulting
Box 945
123 Some Street
Anytown, USA 12345
Notice that it has returns within the quotation marks. There are other ways of creating the returns (see Computation 12: Returns in Text Strings). The second example creates a comma-separated, single-line address like this:
Acme Consulting, Box 945, 123 Some Street, Anytown, USA 12345
In both computations, FirmName and Street2 are optional. But the remaining elements are required. To make them optional as well, surround them with "IF ANSWERED( Variable ) ... " as was done with FirmName and Street2.