Expression | Description |
absoluteValue( num ) | Using the absolute value expression, you can find the absolute value of a given number. You can calculate a negative number, but have it appear as a positive number. |
age( date ) | The age( date ) expression produces an age, in years, by calculating the number of years between the current date (as determined by your computer’s system clock) and a date you provide in the computation script. |
answered ( dialog ) | HotDocs can determine whether a dialog has been answered using the answered expression. Even if only one variable in the dialog is answered, the expression returns a value of true. |
answered ( var ) | You can use the answered expression to determine whether a HotDocs variable has been assigned a value. If so, the expression receives the value of true. |
count( dialog ) | You can find out how many sets of answers a user provides for a repeated dialog. A repeated dialog is any dialog used in a repeat instruction. This expression produces a number, based on each answered dialog. |
count( mult_choice_var ) | This expression counts how many options a user chooses when answering a Multiple Choice variable. The result it produces is a number. |
counter | HotDocs uses counter as a way to compare two incrementing number values. For example, perhaps you want to list the last child named in a repeated dialog. You could create the following computation script: |
date - num days | You can subtract any number of days from a Date variable. The result of this computation is a new date value, which can be merged into the assembled document. |
date - num months | You can subtract a certain number of months from a Date variable. The result of this computation is a new date value, which can be merged into the assembled document. |
date - num years | You can subtract a certain number of years from a Date variable. The result of this computation is a new date value, which can be merged into the assembled document. |
date + num days | You can add any number of days to a Date variable. The result of this computation is a new date value, which can be merged into the assembled document. |
date + num months | You can add any number of days to a Date variable. The result of this computation is a new date value, which can be merged into the assembled document. |
date + num years | You can add a certain number of years to a Date variable. The result of this computation is a new date value, which can be merged into the assembled document. |
dateOf( num, num, num ) | This expression finds a date value based on day, month, and year values. |
dayOf( date ) | This expression returns the day portion (1 to 31) of a given date. |
dayOfWeek( date ) | This expression determines on which day of the week a specific date falls and converts that value to an integer. |
daysFrom( date, date ) | This expression allows you to find the number of days between two dates. |
first( text, num ) | Using this expression, you can return any number of characters starting with the first character in an answer value. |
format( value, "example" ) | Sometimes you may need to add a date, number, or true/false value to a text value. You can do this by formatting the date, number, or true/false value as text. |
integer( text ) | Sometimes you may have a text value that contains number characters, as in the case of a time of day value. The integer expression allows you to convert those number characters into numeric values so you can perform calculations or compare them with other values. |
last( text, num ) | The last expression finds and returns a certain number of characters from the end of a text string. |
length( text ) | The length expression counts the number of characters—including spaces and punctuation—in a text value, such as a Text variable. |
max( num, num ) | The max expression compares two number values and returns the greater of the two. |
mid(text, num, num ) | Like the first and last expressions, this expression extracts a specified number of characters from within a text string. |
min( num, num ) | The MIN expression compares two number values and returns the lesser of the two. |
monthOf( date ) | This expression returns the month portion of a given date. |
monthsFrom( date, date ) | The months from expression calculates the number of months between two given dates. |
mult_choice = text; mult_choice != text | The mult_choice = text expression returns true when the user chooses a Multiple Choice option that is equal to ( = ) a given text value. If it is not equal ( != ), the expression returns false. The mult_choice != text expression functions in the opposite way—testing instead to see if an answer is not equal to (!=) a given text value. |
not true_false | You can use the not true_false expression to find out if a True/False variable is false. |
other( mult_choice_var ) | This expression determines whether the user has chosen the Other option of a Multiple Choice variable and, if so, returns the text entered in the Other field. It can also be used to test whether the user has selected the None of the Above option. |
position( text, text ) | The position expression finds the position of a certain character or character string in a given text value. It is useful if you need to find a character you know will be in an answer but are not sure where it will appear. It returns a number value, which represents the first character. |
power( num, num ) | The power expression generates a numeric value, based on a given exponent. |
remainder( num, num ) | The remainder expression returns the remainder of a division. If the denominator is a zero, HotDocs generates a divide by zero error. |
replace( text, text, text, num ) | This expression lets you search a string of text for a given character string and replace the results with new text. |
result | As you write computations, you often need HotDocs to acknowledge what the result would be at that point in the script. You can update this answer by using the result expression. |
round( num, num) | You can round a number value to a specified number of places. |
selection( mult_choice_var, num) | This expression lets you retrieve individual options (answers) selected in a Multiple Choice variable. It returns a text value that corresponds to the defined answer (as designated by the num placeholder). |
space( text, text ) | This expression tests whether the variable is answered. If it is, it merges the answer, followed by a space character. If the variable is unanswered, it merges nothing (""). |
strip( text, text, true_false, true_false) | This expression removes a specified character or characters from the beginning or end of a text answer. By default, HotDocs removes the characters from both the beginning and the end of the text. If you want to specify just one or the other, you must use the true_false parameters. |
sum( computation_var) | Using the sum expression, you can add computation values that have been repeated. |
sum( num_var ) | Using the sum expression, you can add repeated number values. |
text contains text | The text contains text expression determines whether the first text value contains the same text as the second value. If it does, it returns the value of true. |
today | This expression returns the current date, according to your computer’s system clock. |
truncate( num, num ) | You can truncate a decimal number a specified number of places after a decimal point. |
unanswered | This expression removes an assigned value from a variable. It is used most often with the set instruction: |
union( mult_choice, mult_choice ) | This expression creates a single list of all unique options (answers) that have been selected across two or more Multiple Choice variables. |
value( var, expression ) | This expression returns a default value for the variable type if the variable is unanswered. If the variable is answered, the value is the answer the user specifies. |
yearOf( date ) | You can use this expression model to find the year portion of a given date. |
yearsFrom( date, date ) | This expression calculates the number of years between two given dates. |
zero( num_var ) | This expression returns the value of zero only if a Number variable is unanswered. If the Number variable is answered, the value is the answer the user specifies. |