Automating Punctuation in the generated document

Contract Express can apply punctuation to any list variable or span (including repeating spans). Lists can occur vertically as a series of paragraphs, or horizontally within one paragraph.
The basic premise for punctuation allows for three different punctuation marks to be applied to the list -
First and Following
,
Penultimate
and
Last
. A simple list might be punctuated with a full stop (period) on the last item in the list, a "comma and" (, and) on the penultimate item (i.e. second from last) and everything else in the list should have just a comma applied. Contract Express is able to properly punctuate any length of list using these tree types of paragraph marks by applying them back to front: it finds the last item in the list and applies the punctuation defined for the last item, then finds the penultimate item in the list and applies the defined punctuation character for this item and anything else remaining in the list will have the first and following character applied to it.

Punctuation-types Example1

Consider the following paragraph marks:
First and Following
Penultimate
Last
,
and
.
Now consider the following list from a multi-choice variable:
Telephone
Support
Installation
Training
Email Support
Customisations
By applying the punctuation from the bottom up we get this:
Telephone
Support,
Installation,
Training,
Email Support
and
Customisations.
Now consider a user choosing fewer answers on the multi-choice:
Training and Email Support.

Punctuation types Example 2

Next let's consider these punctuation marks
First and Following
Penultimate
Last
,
,
and the following list of values:
1 St John St
2nd Floor
London
EC1M 4BF
United Kingdom
Using the above punctuation marks, this can be punctuated follows
1 St John St,
2nd Floor,
London,
EC1M 4BF,
United Kingdom
1 St John St, 2nd Floor, London, EC1M 4BF, United Kingdom

Punctuation Character separator

When we set up the punctuation, we separate these three characters using the vertical bar separator character ("|"). So, we get:
, | and |.
and:
,|,|
Once you have decided on your three punctuation mark characters for First and following, Penultimate and Last items in the list, you just need to apply them to your template depending on what you would like to punctuate:

Adding punctuation to variables

Any variables storing a list-type value (this could be a multi-choice text selection variable or a computation variable that concatenates the answers to many questions into one variable) can have punctuation applied to its
Default Format
property. This would be useful if you are using this variable repeatedly across many fields and you want the same punctuation to be used for those fields every time. The Default Format attribute is added Using the Dictionary Editor for that variable. if we were applying punctuation to the ServicesIncluded variable using example 1 above, we would add
, | and |.
to the variable's Default Format area using the Dictionary Editor. See Editing variables for more details.

Adding punctuation to fields

Punctuation can be applied to a field using the Format keyword added just before the closing field bracket. So for the address variable in example 2 above we might add the variable into a field like this:
{BuyerAddress Format ",|,|"}

Adding punctuation to a span

It is also possible to apply punctuation to a span. Consider the following clause regarding tenant responsibilities:
2.1 The tenant:
[
DepositRequired
will pay a deposit]
[
NoticeToTerminate
will give 6 months notice to terminate ]
[
UseOutsideHoursWithNotice
will give 7 days' notice touse the Premises outside the Permitted hours]
is responsible for maintenance and repair for the Premises
is responsible for all window cleaning on the Premises
will not use the Premises for purpose outside the Permitted Use
[
Not SubletPermitted
will not sub-let the Premises]
[
NoUseOutsideHours
will not use the Premises outside the Permitted hours]
If there is no deposit, no notice required, no sub-letting permitted and no use of the Premises outside hours, the clause will consist of 5 lines ending on the Permitted hours clause:
2.1 The tenant:
is responsible for maintenance and repair for the Premises;
is responsible for all window cleaning on the Premises;
will not use the Premises for purpose outside the Permitted Use;
will not sub-let the Premises; and
will not use the Premises outside the Permitted hours.
If there is a deposit, notice required, use outside hours and no sub-letting,
2.1 The tenant:
will pay a deposit;
will give 6 months' notice to terminate;
will give 7 days notice to use the Premises outside the Permitted hours;
is responsible for maintenance and repair for the Premises;
is responsible for all window cleaning on the Premises;
will not use the Premises for purpose outside the Permitted Use; and
will not sub-let the Premises.
We now have
7 lines
ending on the sub-let clause. Thus the punctuation has to reflect the dynamics in this clause.
We do this by surrounding the whole clause in a punctuation span, adding on the punctuation definition and using {Mark} fields wherever we want to add the punctuation:
2.1 The tenant:
[
Punctuation ";| ; and|."
[
DepositRequired
will pay a deposit{Mark}]
[
NoticeToTerminate
will give 6 months' notice to terminate{Mark}]
[
UseOutsideHoursWithNotice
will give 7 days' notice to use the Premises outside the Permitted hours{Mark}]
is responsible for maintenance and repair for the Premises{Mark}
is responsible for all window cleaning on the Premises{Mark}
will not use the Premises for purpose outside the Permitted Use{Mark}
[
Not SubletPermitted
will not sub-let the Premises{Mark}]
[
NoUseOutsideHours
will not use the Premises outside the Permitted hours{Mark}]]

Adding punctuation to a repeating span

When the span is repeated, the Punctuation part of the business rule gets added to the existing Repeat business rule:
The company [
NumberDirectors Is 1
director is][
NumberDirectors IsMoreThan 1
directors are] [
Repeat NumberDirectors Punctuation ", | and |"
{DirectorName}{Mark}].
If the only director is John then the punctuated paragraph will be:
The company director is John.
If the directors are John and Mary then the punctuated paragraph will be:
The company directors are John and Mary.
If the directors are John, Mary, Paul and David then the punctuated paragraph will be:
The company directors are John, Mary, Paul and David.

See Also

Formatting
Field types
Functions