Available only when combined with the If command,  conditional command groups allow you to link commands together as a set in order that they can be processed as a group. Those groups of commands can be entirely different depending upon whether the If command evaluates to True or False.

The start of a group of commands is identified by the Begin command, and the end of the group by the End command. In between are one or more commands to be executed as part of the group.

Why might that be useful? Well, think about version number automation for a start. Instead of writing the same if command multiple times with different command payloads, you can group as many as you want together. A simple example that runs only in a single situation:


@If:NotHasTaskExclusions&&VarEquals,NewBuild,Auto,
Begin:
        Assign:NewBuild,%%IncrementedBuild%%,
        Assign:NewRevision,0,
    End:;


If there are no tasks excluded, then it must be a full build. Therefore increment the build number and set the revision to zero. How easy is that?

Maybe you want to achieve different behaviour depending on the result of the If command? Here is another quick example to demonstrate that:


[Setup]
Var
:Value,true

[Test User Section]
@
If:VarEquals,Value,true,
    Begin:
        Remark:This is the first true Remark,
        Remark:This is the second true Remark|BlankLineBeforeAndAfter,
        Remark:This is the third true Remark,
    End:,
    Begin:
        Remark:This is the first false Remark,
        Remark:This is the second False Remark|BlankLineBeforeAndAfter,
        Remark:This is the third false Remark,
    End:;

; Remarks show in the report or the command prompt so you can see that it has worked correctly
; Rest of the script goes here


The power of this is that *ANY* commands can be grouped together to do whatever you want, and they can be controlled by whatever conditions you choose to define. The number of ways that this can be utilised is limited only by your imagination, so it is incredibly powerful stuff.

Pipeline Runner can make short work of even the most complicated requirements and provide complete automation of complex processes with ease. Once a project script is written, you can run it forever either automatically or on demand saving countless hours and removing all the risk of human error that comes with doing it manually.

 

Responsive site designed and developed by