Lesson 5: Replace Numbers

Overview

This lesson teaches you how to replace numbers—both simple and computed. It also teaches you how to insert the same variable twice, but change how the answer will look each place it is merged in the assembled document.

Even though Social Security numbers, tele­phone numbers, and times of day are numbers, you must use a Text variable with the appropriate pattern to merge one of these numbers into your docu­ment.

You use Number variables to represent text in your template that can be calcu­lated—for example, dollar amounts or other sums.

Start the Tutorial

If you are continuing immediately from Lesson 4, skip the instructions for opening the template and proceed to “Replace Simple Numbers.”

If you closed the template at the end of Lesson 4, complete the following steps.

To open the tutorial template

  1. Open your word processor and click the hotdocs00224.jpgHotDocs button, located on your word processor’s toolbar. The My Test Templates library appears.

    If the My Test Templates library does not appear, choose Open Library (File menu), select the library in the default Libraries folder (for example, My Test Templates.hdl), and click Open.

  2. Select Employment Agreement and click edittemplate00227.jpgEdit. The template appears, ready for you to edit.

Replace Simple Numbers

Hobble Creek Publishing classifies employees into three categories—exempt employees; full-time, non-exempt employees; and part-time, non-exempt employees. The salary for each type of employee is calculated differently.

The first amount you will replace is the 65,000.00 annual salary in the first para­graph of the Compensation and Reimbursement section.

To replace the annual salary with a Number variable

Currency symbols appear next to the prompt when the variable appears during the interview—they are not actually merged into the assembled document.

  1. Select 65,000.00 (do not select the $ character) and click the variable00258.jpgVariable Field button. The Variable Field dialog box appears.
  2. Select Number and type Exempt Annual Salary in the Variable box.

    inset_4200261.png

    Note that when you select Number, HotDocs clears the Use default check box and lists 9,999.00 in the Format drop-down box. This forces HotDocs to include the cents in an answer. (If a user doesn’t enter cents, zeros will be merged.)

    To help the user know what type of answer to enter during the interview, you can specify a currency symbol as well as decimal places for cents.

  3. Click the edit00262.jpgEdit Component button. The Number Variable Editor appears.
  4. In the Prompt box, enter the text Annual Salary.
  5. At the Decimal places box, click the up arrow until the number 2 appears.
  6. Click the Currency symbol drop-down button and select $.
    inset_4300265.png
  7. Click OK at the Number Variable Editor, and click Replace Once at the Variable Field dialog box. The variable is inserted into the template.

Replace the Hourly Wage

The next amount you need to replace is the hourly wage, located in the second and third paragraphs of the Compensation and Reimbursement section. One paragraph describes the hourly salary for a full-time, non-exempt employee, while the other paragraph defines the hourly salary for a part-time employee. In both cases, you will create a single variable, but insert it in both paragraphs.

To replace the hourly wage

inset_4400269.png
inset_4500273.png
inset_4600274.png
  1. In the second paragraph, select 30.00 (do not select the $ character).
  2. Click the variable00266.jpgVariable Field button. The Variable Field dialog box appears.
  3. Select Number as the Variable type and enter Hourly Salary in the Variable box.
  4. Click the edit00270.jpgEdit Component button. The Number Variable Editor appears.
  5. At the Decimal places box, click the up arrow until the number 2 appears.
  6. Click the Currency symbol drop-down button and select $.
  7. Click OK at the Number Variable Editor, and click Replace Multiple at the Variable Field dialog box. The Find and Replace dialog box appears.
  8. Click Replace All. HotDocs replaces this instance of the text, as well as the text in the next paragraph with the variable.

Calculate Annual Salary for Hourly Employees

Computation variables are discussed in greater detail in Lesson 7: Create Computation Variables.

Next, you will replace the non-exempt employee’s annual salary. You could replace these figures with Number variables; however, this would require users to calculate the salary themselves. To save users time and reduce the chance of a mistake, you will create a Computation variable, which will perform the calculation for the user.

To replace the yearly salary with a Computation variable

inset_4700278.png
inset_4900283.png

The different elements in a script must be sepa­rated by spaces.

inset_5000284.png
  1. Select 62,400.00 (do not select the $ character) and click the variable00275.jpgVariable Field button. The Variable Field dialog box appears.
  2. Select Computation and type Annual Salary Full-Time in the Variable box.
  3. Click the edit00279.jpgEdit Component button. The Computation Editor appears.
    inset_4800282.png

    To calculate the annual salary, you must multiply the hourly salary by the number of hours worked in a year. Since you don’t know what the hourly salary is at this point, you will use the Hourly Salary variable in the calculation instead. Then, when the user completes the interview, whatever amount the user enters will be substituted and the yearly salary can be calculated.

  4. In the Components list, select Hourly Salary and drag it to the Script box. (You may need to scroll through the list of components until you see it.)
  5. Press the spacebar to add a space and then drag the multiplication sign (the asterisk * from the Operators list into the Script box following Hourly Salary.
  6. Press the spacebar again and type 2080. (The number 2080 represents how many work hours there are in a given year. It is based on a 40-hour work week.)
    inset_5100285.png

    Now that you have created the calculation, you can test it to make sure it produces the correct result.

To test the calculation

inset_5200286.png

HotDocs prompts you to enter the amount of the hourly salary.

inset_5300287.png
inset_5400288.png

When you return to the Variable Field dialog box, the Use default option is cleared and a default format of 9,999.00 has been suggested for the vari­able.

inset_5500289.png
  1. Click Test. A test assembly window appears.
  2. Type 15.75 for the hourly salary and click the Result tab. The computation result, 32,760, is displayed.
  3. Choose Close File to close the test assembly window. HotDocs asks if you want to save your answers.
  4. Choose whether to save your answers, based on the following information:

    For more information on using test answer files, see HotDocs Help.

    • If you click Save or Save As, you will be prompted to specify an answer file name and title. Type Test Answer File in the File name box and accept the suggested Title. From this point on, this answer file will be used each time you test a variable or test assemble the template, and you will no longer be prompted to save your answers after each test. (You can, of course, choose a different answer file when you are at the assembly window.)
    • If you click Don’t Save, each time you test a variable or test assemble the template, you will use an empty, untitled answer file. You will also be prompted to save your answers each time you finish a test.
  5. Click OK at the Computation Editor.
  6. Click Replace Once at the Variable Field dialog box. The variable is inserted into the template.

On Your Own

Another amount you need to calculate is the annual salary for part-time employees. /p>

In the third paragraph of the Compensation and Reimbursement section, replace 31,200.00 with a Computation variable named Annual Salary Part-Time. Click the edit00290.jpgEdit Component button and enter the following script in the Script box:

Hourly Salary * 1040

Please refer to the previous section if you need help remembering how to do this.

Insert the Number of Vacation Days Variable

Hobble Creek Publishing employees are given a certain number of days annually to take as vacation time. How many days depends on each employee. The number of vacation days is inserted twice in the document, with each instance formatted differ­ently.

To insert the number of vacation days

  1. In the first paragraph of the Time Away From Work section, select the text TWENTY-FIVE and click the variable00293.jpgVariable Field button. The Variable Field dialog box appears.
  2. Select Number and enter Number of Vacation Days in the Variable box.

    std-variable-field-number-of-vacation-days.jpg

    Note that NINE is suggested as an example format. This is correct.

  3. Click Replace Once. The variable is inserted into the template.

Use an Existing Variable

The number of vacation days is inserted a second time, in numeric format. Instead of creating a new variable, you can use the variable you just created. Remember, the same variable can be merged several different places in a template, and the variable’s format can be different for each field.

To replace the number with the variable you just created

std-variable-field-number-of-vacation-days-drop-down.jpg

  1. Select 25 and click the variable00298.jpgVariable Field button.
  2. Select Number and click the Variable drop-down button to see the list of vari­ables.
  3. Select Number of Vacation Days from the list. The variable Number of Vacation Days appears in the Variable box.
  4. Click Replace Once at the Variable Field dialog box. The variable is inserted.

Set Minimum and Maximum Limits

The final number that needs to be replaced with a variable is the number of seminar days allowed each employee. Employees may take no more than five seminar days per year. You can assign a maximum value to keep users from entering more than five days.

To set limits for a Number variable

  1. In the last paragraph of the Time Away From Work section, select the number 3 and click the variable00303.jpgVariable Field button. The Variable Field dialog box appears.
  2. Select Number and type Number of Seminar Days in the Variable box.
  3. Click the edit00306.jpgEdit Component button. The Number Variable Editor appears.
  4. Type 5 in the Maximum box.
  5. Click Test. A test assembly window appears.
  6. Type 6 in the answer field and click the Result tab.

    The warning, Please enter a number between 0 and 5, appears.

  7. Click OK to return to the test assembly window.
  8. Erase the answer and close the test assembly window.

    You can use the clear.jpgErase Answer button in the test assembly window toolbar to clear answers.

  9. Click OK at the Number Variable Editor and click Replace Once at the Variable Field dialog box. The variable is inserted into the template.

Conclusion

You are now finished with this lesson. In it, you learned how to create simple Number variables. You then learned how to create Computation variables to calcu­late amounts. Finally, you learned how to assign minimum and maximum values to a Number variable.

If you do not want to go on to Lesson 6 at this time, click the HotDocs close00311.jpgSave and Close button to close the template. Then exit HotDocs.

If you are continuing on to Lesson 6, click the save00314.jpgSave button to save your work.