Branch Function
The branch function is a unique function in FlowForge, because it does not have any external output points. Rather, it has two output points and only one of them can be executed
If you have done any programming, you may have realized this is basically an if-else statement. In Java, this would be similiar to :
if (condition == true) {
System.out.println("Condition is true!");
} else {
System.out.println("Condition is false :( ");
}
For non-programmers, don't worry. You will learn more about this in this lesson.
1. Creating a boolean node
First, head to the variables section and create a new Boolean node. You can name it anything. The boolean node will be used to operate the Branch Node

2. Connecting it to the Branch Node
Now, we will use a branch Node.
Connect the Start node to a new branch node
Connect the Start node's Output-X to the boolean's "Set" point (input-X)
Connect the boolean to the branch node's "Condition" point (Output-X)

3. Using the "True" and "False" Output points
Now,
Place two Print nodes in front of the branch node
Connect the "True" Output point to one Print node
Connect the "False" Output point to the other Print node

4. Executing the program
When we feed the boolean condition to the branch node, the branch node evaluates it. If the boolean value is true, the nodes connected to the "True" output point will be executed. If the boolean value is false, the nodes connected to the "False" output point will be executed
Now when you run the program, you will see the following output :

This is because the value of our condition boolean node is set to false by default. To change it to true, simply click on the checkbox on the boolean node

Now when we run again :

Voila! Now the node connected to the True output point was executed.
Last updated