Else If / End Else If

The Insert | Flow Control Command | Control Pairs | Else If / End Else If menu option allows you to add a conditional block to the measurement routine. The items between the ELSE IF and the END ELSE IF commands will only execute if the expression for the ELSE IF command evaluates to true (nonzero). The ELSE IF / END ELSE IF block must be positioned directly after an IF / END IF block or another ELSE IF / END ELSE IF block. If all IF / ELSE IF expressions above the current block have evaluated to false, then the expression will be evaluated. If the expression evaluates to false (zero), then execution will jump to the next command following the END ELSE IF command. If any of the if / else if expressions above the current block evaluate to true, all subsequent else if / end else if blocks in this sequence will be skipped.

The Edit window command line for a ELSE IF / END ELSE IF statement reads:

ELSE_IF/expression
END_ELSE_IF/

To insert the Else If / End Else If commands:

  1. Place the cursor in the desired location of the Edit window, after an existing IF/END IF statement or ELSE IF/END ELSE IF statement.

  2. Select Else If / End Else If from the menu bar. The ELSE IF / End ELSE IF statement will appear in the Edit window.

This type of block is only valid when positioned after an IF / END IF or ELSE IF / END ELSE IF block. Invalidly positioned control pairs are shown in red text in the Edit window.

 

More:

Code Sample of Else If / End Else If