Flow Chart

Overview

Showing and Hiding Flow Chart

Changing Flow Chart Position

Inserting Language Constructions

Scrolling and Printing

Overview

Although program code is usually written in textual form, it possesses its own internal structure. While looking at the code contained within a function, it is sometimes hard to recognize the building blocks easily. The DAC Flow Chart engine is capable of rapid source file analysis and display in Flow Chart window of the graphical representation of currently edited function.

Two types of flow chart are common: structured flow charts and non-structured flow charts.

In the various implementations of flow charts, they are usually displayed so that the entire source code is partitioned into fragments and displayed inside the drawn blocks. The DAC Flow Chart is based on a different philosophy, to be explained from here on.

Flow Chart engine is so fast that Flow Chart can at all times be displayed as the alternative view of the currently edited source code. Since Flow Chart can be seen as the alternative view of the source code, these two views are completely synchronized: while moving through Flow Chart, the Editor view always reflects the current position. The same goes for editing – in this case, Flow Chart reflects the corresponding insertion point position in the Editor window.

When Editor recognizes that the source code is about to be changed, Flow Chart becomes grayed, and is not updated until it receives scope. This allows a fast response to editing. Also, flow charts drawn from incomplete code would not make much sense. When code change is completed, a single click on Flow Chart window will make the grey shades disappear – Flow Chart is updated once again. The close connection between Editor and Flow Chart provides a possible solution to a problem present in other flow charting environments. In other environments, where the entire code must be displayed inside Flow Chart, charts usually become too big – so big that they become unusable. The part of Flow Chart being displayed on the screen is so small that the structure cannot be seen.

Instead of this, DAC does not display the entire code in Flow Charts. Since flow charts can always be synchronized with Editor, it is enough to display the code structure and comments from the source inside Flow Chart. The real code can always be edited the way it usually is—inside of the Editor window.

Displaying only comments inside Flow Chart has an additional advantage over the other modes of Flow Chart display. When the details are omitted, the code logic can be seen more easily.

The amount of text displayed from comments can be adjusted. All Flow Chart building blocks are based on the code block. Modifying the code block settings affects practically the entire flow chart. This means that flow chart tweaking should customarily start from the dialog box that configures code blocks.

Another strategy DAC uses with enormously large flow charts is that of expansion levels. The maximum depth of displaying the enclosed blocks can always be specified and easily changed.

If all characters from the comments were displayed, this would often fail to give sensible results. Many comments contain characters used only to improve comments visibility or for drawing borders. This is why the DAC Flow Chart engine will try to recognize and ignore such characters. But, regardless of how smart software can be, humans are smarter. If a fancy bordering scheme for comments is not recognized by the algorithm, you should refrain from using such a scheme if displaying these comments inside Flow Chart diagrams is required.

Flow Chart engine relies on the Symbol database to identify the code conditionally excluded from compilation using preprocessor directives (#if, and so on). If preprocessor directives have been changed in the Editor, the database information should be updated (by choosing, for example, Start > Fast Module Analysis) to obtain an accurate Flow Chart.

Showing and Hiding Flow Chart

To show a flow chart of the function in which the insertion point is positioned, select the View > Show Flow Chart menu command or click the Show Flow Chart toolbar button. Selecting the same menu command or toolbar button will hide Flow Chart. Whether a Flow Chart will be displayed as Structured or Non-Structured, depends on the initial view parameter of the Options > Flow Chart / General dialog box. To switch between these two types, click the Structured Flow Chart or Non-Structured Flow Chart toolbar button, or select the appropriate command from the Graph menu.

You can use the Navigation window to navigate quickly through parts of the Graph. It displays a reduced picture of the entire graph, and clicking any point on the Navigation window positions the view in the main window of the Graph around that particular point.

Changing Flow Chart Position

Flow Chart can be positioned right, left, above or below the Editor view. To change Flow Chart position click the Swap or Rotate toolbar button. Change of position can also be accomplished by setting the initial Flow Chart position parameter in the Options > Flow Chart / General dialog box.

Inserting Language Constructions

Using DAC, you can quickly and easily insert language constructions (if, else, do, while, for, switch, and case) into Flow Chart, and simultaneously into the code of the edited function.

DAC offers two ways of performing this operation:

    Inserting a new block in front of or behind the selected block. This can be used, for example, when designing functions.
    Encompassing one or more blocks by a new construction. Let us suppose that you have, while analyzing Flow Chart of your function, realized that a certain group of blocks should be executed only under a certain condition. Instead of the tedious switching to the Editor window and subsequent typing, you can simply select the appropriate blocks and with a single click subsume them under a conditional block.

When constructions are being inserted, attention is paid to logical code indentation.

Here is how you can insert an if construction behind a particular block:

Position the mouse on the lower border of the block you have selected. You will know that the mouse is on the block border when the insertion point is replaced by a vertical arrow. Select the lower border of the block of your choice and it will turn blue as in figure . Click the if toolbar button or select the Edit > Insert Construct / If menu option. The result of this operation is an inserted if block behind the selected block, as in figure .

Flow Chart: Inserting a construction behind the selected block

Inserting a construction behind the selected block

Flow Chart: Result of the if construction insertion operation

Result of the if construction insertion operation

Inserting a construction above the selected block is carried out analogously.

You can encompass selected blocks by the if conditional block in the following way:
Select the block from which you want the new conditional block to begin, as in following figure:

Flow Chart: Selected block from which the new conditional block will begin

Selected block from which the new conditional block will begin

Click the if Toolbar button if Toolbar button, then select the end block of the new conditional block. In the example, this is the third code block. The result is a new conditional block which encompasses three selected code blocks. You may notice (on the next figure) that the code has been correctly indented after the new construction was inserted:

In the same way you can enter any of the offered language constructions. DAC will ensure that you do not make any mistakes - for example, entering a case construction if a block within the switch expression has not been selected is not allowed. However, you may happen to enter a construction you did not want. In this case, carry out the Undo command in Edit menu and you will have removed the error in a single move.

Scrolling and Printing

If Flow Chart size exceeds window size, you can see the part of Flow Chart which you are interested in using the scroll-bars or the standard key combinations. Likewise, Flow Chart window supports wheel scrolling. If you hold down the Ctrl key and wheel scroll simultaneously, the Fit to Window, that is Normal View operation will be performed. Holding down the Shift key and wheel scrolling changes the global Flow Chart expansion level.

You can print a Flow Chart (the File > Print menu option), copy it to the Clipboard (Edit > Copy) or save it to a WMF file (File > Save As).


Copyright 1993-2014, RistanCASE GmbH