Branching instructions allow you to execute different code, depending on some condition.
In the Q++ Macro Language, there are 2 types of branches :
if-else |
The if type of branch allows you to define 2 paths of execution, depending on the value of a boolean expression. |
switch |
The switch type of branch allows you to define many different paths of execution, depending on the value of a string or integer expression. |
Note that, as the boolean data type only has 2 possible values (true/false), the if branch can be considered to be a special case of the switch statement as defined for booleans.