Punctuate a List of Possessives

From HotDocs Wiki

Jump to: navigation, search

When you insert a list in sentence style, you must choose the punctuation you want for the list. For example, the a, b, and c list format punctuates a list of four names as Daniel, Nathan, Emily, and Kate. However, sometimes you may want to make each item in the list possessive by adding 's. If you try assigning a's, b's, and c's as the format example, you will see that it does not work quite right. In particular, the final name is not made possessive: Daniel's, Nathan's, Emily's, and Kate. In addition, if there are only two names, the comma is not removed: Daniel's, and Kate.

You can use the following computation to correctly add 's to the end of each item in a list, while still punctuating the entire list using the a, b, and c list format. The computation is an ordinary REPEAT instruction with a list format; the only difference is that when each answer is added to the result, it is followed by 's.

Example

REPEAT Repeat Dialog 
  FORMAT "a, b, and c" 
  RESULT + Text Var + "'s" 
END REPEAT

Repeat Dialog Any repeated dialog.
Text Var A Text variable in the repeated dialog.