The HotDocs Computation Archive
Get Extra Help

0113 - No Computation Variable Required

Description:

How to hard-code simple computations right into a template.


• Explanation •

For simple, one-line computations it is not necessary to create a computation variable. Instead put the script directly in your template between chevrons.

Examples: (consider each to be text in a template)

The date four months from today will be «TODAY + 4 MONTHS:3rd day of June, 1990».

The last day of the month of your birthday is «DATE OF( 1, MONTH OF( BirthDate-d ), YEAR OF( TODAY ) ) + 1 MONTH - 1 DAY:6/3/1990».

You are «AGE( BirthDate-d )» («AGE( BirthDate-d ):NINE») years old.

Here is the number rounded to the nearest hundred and formatted as a roman numeral: «ROUND( NumVar-n / 100, 0 ) * 100:IX».

Petitioner is married and has minor children: «IsMarried-b AND HasMinors-b:Yes/No»

«SET PN1 TO 1»«PN1». The paragraph numbering was just reset.

How it works. The trick to remember is that chevrons can contain more than just simple variables -- they can contain entire expressions. The whole expression will evaluate to one of the variable types: text, number, date, or true/false. You can then give the expression a formatting example just as you would a variable: "«expression:format example»".

Limitations:

Anything else goes.

 

• Contributors •

LegalCS