A boolean variable only has two options typically those options are True and False. It can be used to turn something on and off, it can be used to if.then.else statements to verify the presence of something, or even to verify the size or value of something (X>Y =True/False). There are several uses for booleans variables.


In the 'Color me a rainbow' app we will use a boolean to switch between images.


1. The boolean variable or the true/false argument can be found in the logic tab.

BooleanFind.png

2. You will need to add the the True/false argument to a variable and establish whether it will start as true or false.

TrueBoolean.png
FalseBoolean.png


3. Finally, you will need to add it to an if.then.else statement to tell the app to set the variable to the opposite of what it is set on when a button is clicked.

BooleanInUse.png