Determine the Correct Form of a Verb

From HotDocs Wiki

Jump to: navigation, search

When you use a repeated dialog in a template, users can enter any number of answers for the variables in the dialog. Once the answers for each repetition of the dialog are gathered, they can be inserted as a list in the assembled document. Depending on how many answers are entered, however, the assembled document may require a different form of a verb. For example, if a template gathers a list of children, you may need to use is or are depending on how many children are listed.

The following computations determine which form of the verb to be to use. The first version determines the verb form based on how many answers are entered in a repeated dialog. The second version makes the determination based on the number of options a user chooses when answering a Multiple Choice variable. (The Multiple Choice variable must have the Select option set to All That Apply.)

Example

//Example 1: Determine form of verb based on repetitions of a repeated dialog.
"" 
IF COUNT( Repeat Dialog ) > 1 
"are" 
ELSE  
"is" 
END IF 
 
//Example 2: Determine form of verb based on number of Multiple Choice options selected.
""  
IF  COUNT( MChoice Var ) > 1  
"are"  
ELSE  
"is"  
END IF

Repeat Dialog Any repeated dialog.
MChoice Var Any Multiple Choice variable with the Select option set to All That Apply.