The HotDocs Computation Archive  

Text/MC Computations: "" // Computation body here IF RESULT = "" // Fallback value here END IF Number Computations: 0 // Computation body here IF RESULT = 0 // Fallback value here END IF Date Computations: DATE OF( 1, 1, 1582 ) // Computation body here IF RESULT = DATE OF( 1, 1, 1582 ) // Fallback value here END IF
When a computation returns ***Computation***, it means that there was an unanswered variable, usually in an IF ... END IF block. By way of explanation, when HotDocs tests IF Variable = Value, there will be one of three results: TRUE, FALSE, or NULL. A NULL value occurs where Variable is ***Unanswered***, meaning that the expression is neither true nor false. Because it is neither true nor false, HotDocs simply skips the whole structure down to the END IF.
The way to avoid a ***Computation*** result is to start the computation with a default value. The typical defaults are "" (an empty string) for text computations, 0 for number computations (or some arbitrary value that your computation could not produce, such as 7878), DATE OF( 1, 1, 1582 ) or 01 JAN 1582 for date computations, and either TRUE or FALSE for true/false computations, as appropriate. This assures that the computation will have some value. You can then provide a test at the end of the computation to see if the default value remains unchanged (meaning that the body of the computation failed to produce a different value  probably because of an error). If so, you can try to make up for the error with a fallback test.
The following example illustrates this principle. The computation sets the value of the text variable Supervisort according to who the StaffMembert is. If StaffMembert is unanswered or is a name not contemplated in the computation, the fallback will take effect. (Note that simply using an ELSE will not produce the same result, since the ELSE section will never be evaluated if StaffMembert is unanswered).
// Default value: empty string
""
// Choose an appropriate supervisor
IF StaffMembert = "Bill Clinton"
"Can't be supervised"
ELSE IF StaffMembert = "Al Gore"
"Sally's Day Care"
ELSE IF StaffMembert = "Jimmy Dean"
"FDA"
ELSE IF StaffMembert = "Tammy Faye Baker"
"Mary Kay"
END IF
// Fallback value
IF RESULT = ""
"Bill Gates"
END IF
Alternative:
""
SET Supervisort TO UNANSWERED
// Choose an appropriate supervisor
IF StaffMembert = "Bill Clinton"
SET Supervisort TO "Can't be supervised"
ELSE IF StaffMembert = "Al Gore"
SET Supervisort TO "Sally's Day Care"
ELSE IF StaffMembert = "Jimmy Dean"
SET Supervisort TO "FDA"
ELSE IF StaffMembert = "Tammy Faye Baker"
SET Supervisort TO "Mary Kay"
END IF
// Fallback value
IF NOT ANSWERED( Supervisort )
SET Supervisort TO "Bill Gates"
END IF