Expression Model: ANSWERED(VAR) and ANSWERED(DIALOG)

This tip covered the expression models: ANSWERED(VAR) and ANSWERED(DIALOG).  Most often these are used in templates, but they are also used in computations to test whether a variable or a dialog has been answered.  Hotdocs scripts will be interrupted if the value of any required variable is not known.  For this reason, the use of the”answered” function gives a value where no value is known.

What are the elements?

  • ANSWERED: The function
  • VAR: Any variable.  All variables will have an “answered” or “unanswered” status.  Note, that you can force an answered status on a variable under two conditions: (1) if the variable has a “default” and the dialog on which the variable appears has been asked, or (2) the variable is a True/False variable on a dialog with an Ask All setting and that dialog has been asked.
  • DIALOG: Any dialog.  This tests whether the dialog has been “asked” in an interview.

Usage of ANSWERED expression:

  • Usage is disparaged by the software developers as “unnecessary”.  A properly designed template should have sufficient nesting of logic such that you need not test whether a particular variable has been answered.  This is particularly true when you use variable in IF EXPRESSIONS.

     

  • It is also disparaged because the way HotDocs does (or rather does NOT) clear data.  If a variable is “hidden” based on a dialog scripting rule, the hidden variable still retains its value.  For this reason, you should not depend on the answered status of a variable to determine whether a phrase should be included if there are parent conditions not expressed in the template.

     

  • Usage is recommended if you want something special to happen, other than the ordinary, if a variable has not been answered.  While you can use “tokens” in the advanced properties of a variable, you may want to put the rules into a computation.


CLIENT Address 1 TE
IF ANSWERED(CLIENT Address 2 TE)
RESULT + “
“ + CLIENT Address 2 TE
END IF

Expression Model: AGE(DATE)

This tip covers the instruction model: AGE(DATE).  Use this expression if you want to know the age in terms of years as of the current date.  If you want to know the age as of a specific date, other than today, then you will need to use YEARS FROM( DATE , DATE )

What are the elements?

  • AGE: The function 
  • DATE: The start date for measuring the age.  It can be a birth date or the date a debt was incurred.

How do you use it?

AGE(CLIENT Date of Birth DA)

Expression Model: ABSOLUTE VALUE(NUM)

This tip covers the instruction model: ABSOLUTE VALUE(NUM). This model returns the positive (or absolute) value of a number variable.  In some accounting formulas, the result of the formula will be a negative number.  You may want to not the value as a negative, but still be able to treat and format the number based on its positive value

What are the elements?

  • ABSOLUTE VALUE: The function

     

  • NUM: A number value, positive or negative

How do you use it?

Use it in a fillpoint or computation for a variable entered in the system

ABSOLUTE VALUE(Profits NU)

Use it to test the result of a calculation

ABSOLUTE VALUE(Gross Revenue NUExpenses NU)

Expression Model: ZERO(NUM)

This tip covers the use of the instruction model: ZERO(NUM).  When is a number not a number?  When it has no value.  That doesn’t present an issue unless you start running calculations based on an unanswered number.  The solution is ZERO(NUM).

What ZERO expression does is return the number value (if there is a number) or zero.

Use for a sum of different number variables

SET Fruit Total NU TO ZERO(Apples CNT) + ZERO(Oranges CNT) + ZERO(Tangerines CNT)

Use to provide a Total off a Repeat

0
REPEAT Inventory RPT
SET RESULT TO RESULT + ( ZERO(Item CNT) * ZERO(Item Price NU) )
END REPEAT

October Conference Schedule

This October finds me on the road.

Today I was in Lincoln Nebraska.  We ran a seminar on our Nebraska Probate System V (powered by GhostFill).  Over 3 hours we went in detail how to use the system and how to customize the forms.  We are now off to Atlanta for the LexisNexis CIC conference.  Lexis management has invited me to speak on a panel of document assembly specialists on how to make the most out of practice automation.  I have a little surprise … a preview of a real “sexy client”.  Attend the session and find out.