Adding Spacing to Dialog Elements

When working with Dialog Elements, particularly Horizontal Lines, you may wish to add a line (or vertical space) before the dialog element.  You COULD add a separate dialog element for the spacing. But that adds to your scripting and dialog management.  Instead, you should add a <.pm> Code before and after the Prompt for the Dialog Element.

  • Create the Dialog Element
  • Set to Horizontal Line
  • Choose Alignment:  Left/Center/Right
  • In the Prompt, Right-click and add a Paragraph Marker
  • Type your prompt
  • At the end, Right-click and add another Paragraph Marker

Optional, you can add formatting around the prompt to control things like Bold and Italics.

Ghostfill Create a progress bar

There are times where you wish to give the users information that progress is being made during an assembly, or some indication of where they are.  GhostFill has a progress bar utility. It can be invoked and then controlled by a script. That script is up to you.

%[x = dialogs.Utils.CreateProgressBar]
%[x.title = “This is my Title”]
%[x.show]

%[x.progress =0.1]
%[x.progress =0.2]
%[x.progress =0.3]
%[x.progress =0.4]
%[x.progress =0.5]
%[x.progress =0.6]
%[x.progress =0.7]
%[x.progress =0.8]
%[x.progress =0.9]
%[x.progress =1]
%[x.hide]

This code illustrates how to create and control the progress bar. It is up to you to create the rules for each of the progress codes. It could be a clock timer, or it could be just some condition.

Filtered ADDing to MC Variables

Quite often, you’ll want to dynamically create the options of a multiple choice variable from a repeating dialog (or other source).  This HotDocs snippet will detail how you can do that.  The concept is simple – if you ADD an option to the MC variable, you also accumulate the ADDed value in a text string, so that you can test against that string later.  Then, each iteration, you test whether the current value you may wish to add already exists in the text string and if it does, you do NOT ADD it.  If it does NOT exist, you ADD it to the MC variable, and also to the text string.

In this example, we are repeating through a list of generic party names (essentially a database on the fly in HotDocs, using a REPEAT dialog), and adding names to a multiple choice variable for possible Guarantors.  Testing TE is the text variable that will store each unique value as it is ADDed to the multiple choice variable.  Party Name CO is a computation that assembles the full name of a given party, much like you’d see anywhere else in a HotDocs system.  On this note – it is quite often easier to build a computation specifically to use in this scenario, so that you can do all your error checking & string building there, leaving your ADD instructions simple and clean (even if you are only joining two unconditional vars together, it LOOKS cleaner).  Guarantor Select MC is the multiple choice variable that we are building on the fly.

//clear & clean our values
CLEAR Guarantor Select MC
SET Testing TE TO “”
//lets go
REPEAT Party RPT
IF Testing TE CONTAINS “«Party Name CO»”
//do nothing
ELSE
ADD “«Party Name CO»” TO Guarantor Select MC
SET Testing TE TO Testing TE + “ «Party Name CO»”
END IF
END REPEAT

You could also use a HotDocs Filter to do this however, this approach is “safer” for one reason…as soon as you filter a repeated dialog in HotDocs, the system var counter is altered.  If I wanted to use my new multiple choice variable as a lookup to Party RPT in this example, my ADD line would look something like this:

ADD “«COUNTER:009»|«Party Name CO»” TO Guarantor Select MC

This would mean that the option is the COUNTER value (meaning index) of the dialog that it came from, while the prompt is the party’s name.  If you are using filter, and the filter actually strips out an iteration from Party RPT, the COUNTER will be WRONG.  Yes, wrong!  No, this is not a bug in HotDocs, it is intentional as COUNTER with a FILTERed dialog will reflect the filtered answers rather than the “complete” answers.  To explain a little more clearly, lets take a look at a repeating dialog answer set that contains a duplicate entry:

1 Jack Jones
2 John James
3 Jack Jones
4 Michael Davis

Using filters and the above ADD code, you would get a list that looks like this:

(1) Jack Jones
(2) John James
(3) Michael Davis

Michael’s index in Party RPT is actually 4, but because the 2nd occurrence of Jack Jones got stripped out, HotDocs changed his COUNTER value to 3 (because this is his index in the FILTERed answer set).  This means you cannot use your MC variable to index Party RPT later, because Michael’s entry will actually index incorrectly.  If however we use IF statements instead of a FILTER, we would get:

(1) Jack Jones
(2) John James
(4) Michael Davis

No filters means that COUNTER is once again a reliable indexing tool.  This minor difference may not make any difference to many HotDocs developers out there.  But if you are populating dynamic lists and starting to toss around (or centralize!) data, be aware – FILTERing repeats can be problematic.  The rule is simple: if you intend to use a COUNTER in your ADD statement, dont use filters.  If you must use filters, you must use a manual COUNTER that you define, control & increment yourself.  Bear in mind that this can lead to endless loops and irritating code, so I try to avoid it where possible (which I get away with most of the time).

TMSave Toolbar in Word after an Upgrade to TMW6

When upgrading from Time Matters 5 to Time Matters 6, many users will take a wait and see attitude. They will install Time Matters 6, but NOT install Time Matters 5. This is generally not a problem with the database, since Time Matters creates a separate database during the upgrade. However, it is a problem with the TMSave Toolbar in Word which will often continue to point to the old database. The TMSave toolbar and the menu items are inserted into Word via a Startup Template. This template is loaded when Word is loads. There is a TMW5 templates and a TMW6 template. When you uninstall Time Matters 5, it removes the TMW5 template. If you keep both active, you will have a toolbar with links to both databases. Both toolbars will look identical. Depending on which you click first, you will have links to the TMW5 or the TMW6 database.

The solution is to uninstall Time Matters 5. Go into Control Panel and choose add-remove programs. Find Time Matters 5 and click on Remove. This should remove the TMW5 template. Then restart Word. There is no requirement to reinstall Time Matters. In some circumstances, the TMW6 startup template may not have been installed in the first place. In this case you have two options. One is to reinstall Time Matters, but this time choose only Word-Processor links. The other option, is to go into Workstation Setup and click on Word Processor Links or Additional Product links.

Interview Computations (Best Practices)

A few recent posters to the HotDocs list have suggested it was not “best practices” to use computation in the INTERVIEW computation; that is was best to use a series of ASK statements, surrounded by IF EXPRESSIONS to guide the interview. This Blog add looks into Best Practices for creating a document-scope INTERVIEW computation in HotDocs

Related Link: General information on HotDocs

A few recent posters have suggested it was not “best practices” to use computation in the INTERVIEW computation; that is was best to use a series of ASK statements, surrounded by IF EXPRESSIONS to guide the interview.

Best practices are always best understood in context:  what is the purpose of the practice; when is this practice appropriate.  In the case of using computations inside the INTERVIEW computation, there are a number of competing factors that affect your choice.

READABILITY: The purpose of the interview computation is to define the scope of the INTERVIEW for a document.  To this end, it is meant for a sequence of ASK statements.  The more you can focus on what is being asked, and place it on the dialog, the easier it will be to debug scripting issues arising from “misplaced dialogs” and “orphan variables”.  There may also be a benefit for those using HotDocs Online, where it is indeed best practices to explicitly state the order of dialogs asked.

SPEED OF PROCESSING: There are times where HotDocs processes or calculates certain scripts FASTER than other ways, used by more experienced developers.  I have found a modular master interview, with optional calls out to computation variables that contain the dialog asking sequence to actually run faster.  In a Master Will, I might have a sequence dealing with pre-residuary gifts that I would isolate from the main interview in its own computation.

DATA-MANIPULATION: HotDocs 6 and HotDocs 2005 fundamentally changed the way HotDocs processes data.  It changed from a “linear processing” to “recursive processing” whereby each new data entry leads to a recalculation of the complete interview tree. Being aware of this has led to certain best practices on our part, namely using either (1) Buttons that launch computations or (2) computation scripts in the main interview that contain “flags” to determine whether or not they have been launched.

MASTER CMP vs. DISTRIBUTED CMP: also known as MATTER SCOPE INTERVIEW vs. DOCUMENT SCOPE INTERVIEW:  I am a big believe of Matter Scope Interviews; a single CMP file that launches a master interview that start out with a Document Selection dialog, and then renders a custom interview based on the document(s) selected.  In such an environment, interview scriptlets (or subinterview computations) are critical.  On the otherhand, if you are only doing document scope interviews, which work in a system with shared matter-scope answer file, it would be easier to keep the scripting to simple ask statements in the INTERVIEW file.

Dealing with Irrelevant Answered Variables in HotDocs

Irrelevant answered variables in HotDocs can have their consequence.  This blog notes the problem, its consequences and some solutions.

HotDocs is very friendly, as programs go, in dealing with “unanswered” data.  HotDocs gives you the option, if it doesn’t have sufficient data to fill in a variable or figure out an IF Expression, to display (1) Nothing, (2) A line, (3) [Variable Name] or (4) *** Variable Name ***.  This friendliness, has some consequences.

As recently posted on the HotDocs list, one consequence is that if a field “is answered” and stored in the answer file, but not relevant to a particular set of interview choices, that answer will still be used in the assembly.  The result will be that “irrelevant client data” will show up in the document.

The solution to this problem is to properly nest variables and conditions.  This is not as easy as it seems.  In a complex template, the web of dependencies and conditions can be difficult to track down.  Good dialog scripting and organization can help, but it can take some time to hunt down the proper conditions.  More often, you can over conditionalize a variable, and whole sections that should be relevant will not come in.  Because the “interview script” and the “template” are independent objects in the assembly system, both have to be separately validated and scripted.