Perform actions for various conditional statements

Perform alternate actions for true or false conditions

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Replace My_expression with the first expression to evaluate.
  4. Enter the action to perform if the condition is true, on the line between the If-Then statement and the EndIf statement.
  5. Leave your cursor at the end of the action you just entered, and select Else from the drop-down list.
  6. Enter the action to perform if the condition is false, on the line between the Else statement and the EndIf statement.

When you enter the actions to perform, you can use the choices in the Snippets area to insert a function at the cursor location. You can then add the appropriate arguments for the function.

Note: You can also enter any of the text described in these steps manually; however, using the drop-down lists and snippets can reduce mistakes.

Perform action only if one condition is true

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Replace My_expression with the expression to evaluate.
  4. Enter the action to perform if the condition is true, on the line between the If-Then statement and the EndIf statement.

When you enter the action to perform, use the choices in the Snippets area to insert a function at the cursor location. You can then add the appropriate arguments for the function.

Note: You can also enter any of the text described in these steps manually; however, using the drop-down lists and snippets can reduce mistakes.

Perform no action for condition

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Position the cursor between the two inserted lines, and select Else from the drop-down list.
  4. Replace My_expression with the expression to evaluate.
  5. <recommended> Enter a comment, such as ‘do nothing, to replace what would normally be an action in the statement.
    • Enter the comment at the end of the If-Then statement to perform no action if the condition is true.
    • Enter the comment after the Else statement to perform no action if the condition is false.
  6. Enter the action to perform for the true or false condition, depending on which condition is to include the action.

When you enter the action to perform, use the choices in the Snippets area to insert a function at the cursor location. You can then add the appropriate arguments for the function.

Note: You can also enter any of the text described in these steps manually; however, using the drop-down lists and snippets can reduce mistakes.

Perform alternate actions for more than two conditions

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Replace My_expression with the first expression to evaluate.
  4. Enter the action to perform for the condition, between the two lines.
  5. With the cursor at the end of the action you just entered, select ElseIf...Then from the drop-down list, and replace My_expression with the next expression to evaluate.
  6. Enter the action to perform for this condition, on the blank line below the condition.
  7. Repeat the previous two steps as many times as necessary to accommodate the remaining conditions.

When you enter the actions to perform, use the choices in the Snippets area to insert a function at the cursor location. You can then add the appropriate arguments for the function.

Note: You can also enter any of the text described in these steps manually; however, using the drop-down lists and snippets can reduce mistakes.

Perform alternate actions based on comparison to test case

Select Case <test expression>
Case <expression list 1>
<statement list 1>
Case <expression list 2>
<statement list 2>
Case Else
<statement list n>
End Select
  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select Select Case from the Keywords drop-down list in the toolbar.
  3. Add a space at the end of the statement you inserted, and then enter the test expression.
  4. Press Enter, and select Case from the Keywords drop-down list in the toolbar.
  5. Add a space at the end of the statement you inserted, and then enter the first expression to compare against the test expression.
  6. Enter the action to perform for this condition, on the blank line below the expression.
  7. Repeat the previous two steps as many times as necessary to accommodate each expression.
  8. Position the cursor on a blank line below the last expression, and select Case Else from the Keywords menu.
  9. On the blank line below the statement you inserted, enter the final Case clause to trap unexpected results, and press Enter.
  10. Position the cursor on a blank line below the last expression, and select End Select from the Keywords menu.

When you enter the actions to perform, use the choices in the Snippets area to insert a function at the cursor location. You can then add the appropriate arguments for the function.

Note: You can also enter any of the text described in these steps manually; however, using the drop-down lists and snippets can reduce mistakes.