In his tutorial, we will learn about the Flowgorithm Declare statement. Declare statement is used to create variables in the flowchart. Programmers should explicitly declare the variable before using it in the Flowgorithm flowcharts.
The Declare symbol is a rectangle shape with a horizontal and vertical line inside the rectangle as shown below:
The Declare statement is used to create a variable and arrays in the flowchart. We can use the variable to store and retrieve data in the flowchart. When the symbol is not used it appears in gray color by default.
Let’s create a variable called height using the Declare symbol. The data type for the variable is Real.
- Double click on the symbol to create a variable.
- Type the variable name in the textbox.
- Choose the Type: Real
- Click on the OK button.
The Declare symbol turns into pale yellow color. The symbol will now display the variable data type and the variable name.
That’s it. We have successfully created a variable in the flowchart. Now, we can store a value using the Assign flowchart symbol.
We can declare multiple variables of the same data type using a single Declare statement. We can declare multiple variables by separating the variable names with commas.
For example, we have declared the length and height of type Real using a single Declare symbol.
The following are examples of XML tags for the Declare symbol in the .fprg flowchart file.
|XML||Flowchart Declare Symbol|
|<declare name=”” type=”Integer” array=”False” size=””/>
The XML tag for the Declare flowchart symbol. The symbol and the tag when the variable is not declared.
|<declare name=”num” type=”Integer” array=”False” size=””/>
The XML tag for the Declare flowchart symbol. The symbol and the tag when the variable is declared. The variable name is the num of the Integer data type.
|<declare name=”arr” type=”Integer” array=”True” size=”10″/>
An array variable arr declaration of the Integer data type. The size of the array is ten.
Flowgorithm flowchart tutorials on this website:
For more information on the Flowgorithm tool, please visit the official website at: