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 on other persistent storage devices.
The common file type is the text file with a *.txt file extension. Text files are human-readable.
On Windows operating system, we can create text files using File Explorer and other text editor software. Common text editor software examples are Notepad, Notepad++, TextPad, etc.
File I/O Symbols
To support this feature, four new flowchart symbols are introduced in this version. The new symbols are as follows:
The default File symbols and the usage are as follows:
|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.|
The File symbols and the XML tags that would be represented in the .fprg flowchart file.
|XML||Flowchart File I/O Symbols|
|<open expression=”"input.txt"” mode=”read”/>|
The XML tag for the file Open symbol. The file is input.txt and the file mode is Read.
The XML tag for the Read file symbol. Each line in the file would be stored in the specified variable line.
The XML tag for the Write file symbol. The contents of the string variable str would be written to the file.
The XML tag for the Close file symbol. This would close the file handle in the flowchart.
Flowgorithm flowchart tutorials on this website:
For more information on the Flowgorithm tool, please visit the official website at: