Conditions and Conditional Blocks
Conditions
A condition is made up of three elements:
- a conditional instruction;
- a comparison value (it can be a tax cell or a value); and
- an operator.
Conditional blocks
A conditional block is a paragraph that does not appear in the letter except under certain conditions. In letters supplied with Corporate Taxprep, almost the entire letter appears in conditional blocks.
A conditional block begins with the instruction [IF () THEN] and ends with the instruction [END]. The intermediate instructions [ELSE] and [ELSE IF] allow you to create multiple level conditions.
Structure of a conditional block
The following example shows the various elements which make up a conditional block:
|
The first condition of this block contains three elements:
In an actual letter the condition can be much more complex and include many tax cells and operators. |
|
The instruction [IF () THEN] is the starting point of the conditional block. |
|
The entire conditional block is defined by the instructions [IF ()THEN] and [END]. |
|
The element [ELSE IF] is an intermediate instruction in the conditional block, which determines what will be printed should the first condition prove false. This instruction as well as the instruction [ELSE] allow the construction of several levels of conditions. |
|
The [END] instruction is the final point of the conditional block. |
|
The tax cell [Balance unpaid] is used here to print the cell amount if the condition is true. The whole paragraph will be printed, including the cell. |
Multiple level conditions
Using the conditions [ELSE] and [ELSE IF], you can also insert a condition within a condition. You can thus specify a general condition and then decide which paragraphs within the general condition must meet an additional condition.
To create a condition, proceed as follows:
- In the Insert menu, click Condition to insert the conditional instruction that you want to use.
- Insert the cell that you want to compare inside parentheses within the conditional instruction.
- The Set the Condition dialog box displays.
In the Operator box, select the comparison operator that you want to use.
In the Value box, select the value that you want to compare. In the case where you insert a cell with predefined values,Corporate Taxprep will display a choice of values. - Click OK.
- To add one or several other conditions, repeat steps 2 to 4.
However, when completing step 3, in the second Operator box, select the logical operator that you want to use in order to separate the two conditions.
Notes: The format to use for comparison values is the following:
|
To modify a condition included or not in a conditional block, proceed as follows:
- Select the elements of the condition that you want to modify.
- Modify the elements directly or using the commands available under the Insert menu.
You can change the operators, the comparison values and the text in the condition. However, the tax cells used as comparison values or elements of the bloc of text cannot be modified this way; they must be inserted from the forms pane.
To delete a condition or an entire conditional block, proceed as follows:
- In the case of a condition, select the text after
the opening parenthesis "(", then continue the selection until
you reach the character preceding the closing parenthesis ")".
In the case of a conditional block, select the instruction [IF ...] at the beginning of the block, then continue the selection to the instruction [END]. - Press Del.
You must be careful because deleting the instruction [IF ...] without deleting the matching instruction [END] (and vice versa) can cause errors when displaying and printing the letter. The Letter Editor will warn you that an [IF ...] instruction has no matching [END] when entering Test mode.