In order to use variables in Flowgorithm you first “declare” them (i.e. get a space in memory for them) and then “assign” them a value.
Flowgorithm allows variables to be declared using 5 types:
Boolean (e.g. true, false) These are the basis of decision making in a program. Stores either true or false only.
Real (e.g. 5.2, 850.0, -42.1) Can store numbers with decimals either positive or negative.
Integer (e.g. 325, -42) Can store whole numbers either positive or negative. If it is used in a calculation which would normally return a decimal, it will drop off the remainder.
String (e.g. “Hello World!”) Can store text data. Individual strings can be combined to create longer messages. Usually used to output instructions to the user or to add labels to other data.
- Arrays can be made up of any of the four basic types: Boolean, Real, Integer or String. This means that we have several spaces in memory that we can refer to using the same variable name.