END IF Instruction

The END IF instruction defines the end of a conditional region.

The END IF Instruction is available when you are creating a script in the Component Studio or from the Field Editor in a template.

You must use an END IF instruction after an IF instruction to close the conditional region.

At the end of a conditional region you create using an IF instruction (or any combination of IF, ELSE IF and ELSE instructions), you must add an END IF instruction to close the conditional region.

Instruction name Model After you drag and drop the model into the script tab:
END IF END IF You don't need to do anything further with this model.

Example

For example, in the following script, HotDocs uses an IF instruction to insert a paragraph about vacation time—but only if the new employee qualifies for paid vacation:

«IF Vacation Days»In addition, «Employee Name» shall be allowed «Number of Vacation Days:ten» for vacation time.

«Employee Name» shall also receive seven paid holidays, including New Year's Day, Memorial Day, Fourth of July, Labor Day, Thanksgiving (including the day after), and Christmas.«END IF»

More complex situations can also be handled using IF expressions. For example, in the following computation script, a single paragraph in a template may change depending on how close a project is to completion. Using the IF, ELSE IF, and ELSE instructions, the correct paragraph can be inserted:

IF Project Status = "Complete"

"Upon finishing the project…"

ELSE IF Project Status = "In Process"

"While working on the project…"

ELSE

"Before working on the project…"

END IF

Download

After you download the example template, you can import the template to any workspace to see this example code in action.