Difference between revisions of "Decision Icon Properties"

From Flowcode Help
Jump to navigationJump to search
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
<sidebar>Sidebar: Icon Properties</sidebar>
 
<sidebar>Sidebar: Icon Properties</sidebar>
[[File:Btn_Decision.gif]] &rarr; [[File:Gen_Decision_Flowchart_Icon.png]] &rarr; [[File:Gen_Decision_Icon_Properties.png]]
+
{| style="margin:auto; text-align:center;"
 +
|-
 +
|[[File:Btn_Decision.gif|border]]
 +
| width="50px" |&rarr;  
 +
|[[File:Gen_Decision_Flowchart_Icon.png]]  
 +
|width="50px" |&rarr;  
 +
|[[File:Gen_Decision_Icon_Properties.png]]
 +
|}
  
 
Decision icons allow you to test a condition and redirect the flow according to the outcome.
 
Decision icons allow you to test a condition and redirect the flow according to the outcome.
Line 14: Line 21:
  
 
The decision box tests this condition to see which branch to continue down. If the condition evaluates to 0 or false then the 'No' branch is chosen. If the condition evaluates to a non zero number or true then the 'Yes' branch is chosen. Conditions can be made up from numbers, variables and operators:
 
The decision box tests this condition to see which branch to continue down. If the condition evaluates to 0 or false then the 'No' branch is chosen. If the condition evaluates to a non zero number or true then the 'Yes' branch is chosen. Conditions can be made up from numbers, variables and operators:
See Calculation icon properties for a list of valid operators.
+
 
 +
See [[Calculation Icon Properties]] for a list of valid operators.
  
  
Line 32: Line 40:
  
 
INVX = NOT X
 
INVX = NOT X
 +
 +
 +
To test for two or more conditions, write tests for the individual conditions and combine them with logical operators.
 +
 +
When both conditions must be true: condition1 && condition2
 +
 +
When one condition being true suffices: condition1 || condition2
 +
 +
 +
 +
Assuming that the variables have been previously defined, all the following are valid conditions.
 +
 +
(DELAY = 1) && (X = 0)
 +
 +
(DELAY = 1) || (DELAY = 4)
 +
 +
(DELAY = 1) || ( (DELAY = 3) && (X = 0) )
  
  
 
'''Variables Arrow'''
 
'''Variables Arrow'''
  
Clicking on the down arrow brings up the variables dialog window allowing you to select an existing variable or to create a new one.
+
Clicking on the down arrow brings up the variables dialog window allowing you to select an existing variable or to [[Creating Variables|create a new one]].
  
  
Line 47: Line 72:
  
 
Flowcode treats zero as false and any non-zero value as true.
 
Flowcode treats zero as false and any non-zero value as true.
 +
 
This allows the use of variables in a true or false context.
 
This allows the use of variables in a true or false context.
 +
 
For example 'If TIMEUP' would execute the 'Yes' path if TIMEUP was non-zero.
 
For example 'If TIMEUP' would execute the 'Yes' path if TIMEUP was non-zero.
 +
 +
 +
====Video instructions====
 +
 +
See the [http://www.youtube.com/watch?v=iLT7rwsSL88&list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Decision] video to learn how to use the Decision icon effectively with other icons such as [[Input Icon Properties|Input]], [[Output Icon Properties|Output]] and [[Delay Icon Properties|Delay]] icons.
 +
 +
<div align="center">
 +
{{#ev:youtube|iLT7rwsSL88|640}}
 +
</div>

Latest revision as of 13:06, 15 November 2013

<sidebar>Sidebar: Icon Properties</sidebar>

Btn Decision.gif Gen Decision Flowchart Icon.png Gen Decision Icon Properties.png

Decision icons allow you to test a condition and redirect the flow according to the outcome. Icons can be placed in either branch from the decision icon.


Display Name

The name of the icon that appears on the flowchart.


Condition

The decision box tests this condition to see which branch to continue down. If the condition evaluates to 0 or false then the 'No' branch is chosen. If the condition evaluates to a non zero number or true then the 'Yes' branch is chosen. Conditions can be made up from numbers, variables and operators:

See Calculation Icon Properties for a list of valid operators.


Numeric values can be in decimal (unmarked) or in HEX format (preceded by 0x) or in Binary format (preceded by 0b) e.g. 255 or 0xFF or 0b01010101.


Assuming that the variables have been previously defined, all the following are valid conditions.


DELAY = DELAY + 1

DELAY = (MYVAR + 3) * 3

NEXTBIT = LASTBIT >> 2 & MASK

AANDB = PORT_A AND PORT_B

INVX = NOT X


To test for two or more conditions, write tests for the individual conditions and combine them with logical operators.

When both conditions must be true: condition1 && condition2

When one condition being true suffices: condition1 || condition2


Assuming that the variables have been previously defined, all the following are valid conditions.

(DELAY = 1) && (X = 0)

(DELAY = 1) || (DELAY = 4)

(DELAY = 1) || ( (DELAY = 3) && (X = 0) )


Variables Arrow

Clicking on the down arrow brings up the variables dialog window allowing you to select an existing variable or to create a new one.


Swap Yes and No

Normally the 'Yes' path of execution goes off to the right of the decision icon and the 'No' path carries on down the flowchart. Select this option to swap the two branches around.


Boolean values

Flowcode treats zero as false and any non-zero value as true.

This allows the use of variables in a true or false context.

For example 'If TIMEUP' would execute the 'Yes' path if TIMEUP was non-zero.


Video instructions

See the Decision video to learn how to use the Decision icon effectively with other icons such as Input, Output and Delay icons.

{{#ev:youtube|iLT7rwsSL88|640}}