Site icon TestingDocs.com

Flowgorithm File I/O Symbols

Overview

In this tutorial, we will learn about  Flowgorithm File I/O symbols. Flowgorithm 3.0 supports the reading and writing of text files in flowcharts.

A file is a collection of data that resides on a hard disk or other persistent storage devices. The common file type is the text file with a *.txt extension. Text files are human-readable. We can create text files on the Windows operating system using File Explorer and other text editor software. Common text editor software examples are Notepad, Notepad++, TextPad, etc.

File I/O Symbols

Four new flowchart symbols are introduced in this version to support this feature. The new symbols are as follows:

The default File symbols and the usage are as follows:

 

Symbol Name Purpose
                                                     Open
An Open statement allows reading or writing operations on a file in the flowchart. This will create a file handle for the file in the flowchart.
Read A Read statement reads a value from the open file and stores it into the flowchart variable.
Write A Write statement evaluates an expression and writes the result to the open file.
Close A Close statement closes an open file. This makes the file available to the operating system.

 

XML Syntax

The File symbols and the XML tags that will be represented in the .fprg flowchart file.

XML Flowchart File I/O Symbols
<open expression=”&quot;input.txt&quot;” mode=”read”/>

The XML tag for the file Open symbol. The file is input.txt, and the file mode is Read.

<read variable=”line”/>

The XML tag for the Read file symbol. Each line in the file would be stored in the specified variable line.

<write expression=”str”/>

The XML tag for the Write file symbol. The contents of the string variable str would be written to the file.

 <close/>

The XML tag for the Close file symbol. This would close the file handle in the flowchart.

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

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

 

Exit mobile version