Qu-Bot, A Quickly Programmable Robot User’s Manual
Page
36
of
52
6. Programming in Qu-Bot Visual LAB (Conditional Blocks)
Sometimes we need to alter our actions in the face of changing circumstances. If there
is an obstacle we need to turn our Qu-Bot right. You can notice that these decisions
depend on some condition being met. We can check such conditions from these
conditional blocks. In this chapter we will learn how to use blocks listed under Section
3.1.3.3.
6.1. IF(Condition), ELSE IF(Condition), ELSE & ENDIF blocks
6.1.1. Structure
Once you drag IF(Condition) block the code flow window will look like left image. If
you do not want ELSE block you can right click on the block and select delete (See
3.2.4). Then your code flow will look as shown in center image.
*If you delete ELSE from any IF structure you will not be able to restore it.
ELSE IF(Condition) can be put between IF and ELSE Block. If there is no ELSE block it
can be put anywhere in between IF(Condition) and ENDIF blocks. There can be
multiple ELSE IF(Condition) blocks as shown in right figure. To add ELSE IF(Condition)
block drag the block on IF(Condition) block.
6.1.2. Condition Building, Operands and Operators
Left click on IF(Condition) block to see attributes of this block. Click on Condition
Value block in attribute explorer. You will see a condition builder window as shown
below.