Site icon TestingDocs.com

Flowgorithm Declare Statement

Overview

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.

Declare Statement

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.

Example

Let’s create a variable called height using the Declare symbol. The data type for the variable is Real.

 

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.

Multiple Variables

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.

XML Syntax

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 Tutorials

Flowgorithm flowchart tutorials on this website:

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at:

http://flowgorithm.org/

Exit mobile version