Application icon

if - else - endif

The if - else - endif statements provide the ability to selectively execute statements within an action. The else statement is optional and the sequences can be nested.

There are two modes of the if statement: one tests the action test state and the other tests a track variable in the current set of available files.

When test if the action test state is selected, the if statement conditionally executes statements based on the action test state being the same as a specified state of true or false. Either the if statements or optionally the else statements; but never both will be executed.

Example 1:

Example 2:

Example 1 tests if all active files have a genre of Rock. Example 2 tests if any active file has a genre of Rock.

The if statement used in examples 1 and 2 does not allow for the handling of both cases. ie. Files with and without a genre of Rock.

The test if Variable n mode allow you to get around the above restriction.

Example 3:

With the if statement as configured in example 3, a track variable in each available file is tested. The result of the test determines which files are available in the if portion of the construct and which file's are available in the optional else portion of the construct. Note that the first statement in example 3 saves individual true or false results to track variable 0.

The three primary compare statements: Compare Dates, Compare Numeric, Compare Text and others allow the setting of a track variable to preserve per file results of a test.

File availability statements can be used with the test if Variable n mode to modify the set of selected files inside the if or else sections. However, when the optional else portion is started the appropriate file availability as determined by the if criteria is restored. Further, whenever endif is encountered or the construct is exited, the initial set of available files in effect when encountering the if are restored.