Using PseudoEditor
Flowchart mode
Turn a program into a flowchart and back, follow a run block by block, and edit from either view.
Open flowchart mode
Open a file, then select the flowchart button in the toolbar. Select it again to go back to the code. The flowchart is the same program: edit either view and the other follows, keeping your keywords, comments, blank lines, and indentation.
Flowchart mode needs a mouse or trackpad, so it is available on desktop and laptop screens but not on phones and tablets. Fit View in the canvas controls zooms out until the whole flow is on screen.
How code becomes shapes
Every statement is drawn. IB's loop until is tested before its body, which runs on No; OCR's do ... until and switch are drawn like REPEAT and CASE.
| Code | Drawn as |
|---|---|
INPUT, OUTPUT | Input / output parallelogram |
IF, ELSEIF, WHILE, FOR | Decision; Yes leaves on the right, No from the bottom, and a loop's body has an arrow back |
REPEAT ... UNTIL | The body, then a decision after it: No loops back up, Yes carries on |
CASE | A chain of decisions such as Choice = 1, one per option, with OTHERWISE last |
PROCEDURE, FUNCTION | A flowchart of its own beside the main one, from its header line to Return |
CALL | Subroutine box |
Assignments, DECLARE, RETURN, comments | Process block, exactly as written |
An example
Open this program in flowchart mode. REPEAT and CASE become decisions in the main flow, and Greet gets a flowchart of its own to the right.
DECLARE Count : INTEGER
PROCEDURE Greet(Name : STRING)
OUTPUT "Hello ", Name
ENDPROCEDURE
Count <- 0
REPEAT
Count <- Count + 1
UNTIL Count >= 3
CASE OF Count
1 : OUTPUT "One"
3 : CALL Greet("Three")
OTHERWISE : OUTPUT "Other"
ENDCASEFollow a run
Press Run while the flowchart is open. The program runs as usual, asking for INPUT in the terminal, and then the flowchart replays it: each block lights up as the program reaches it, the arrow it followed is highlighted, and blocks it hasn't reached yet are faded.
The bar above the chart plays the run or steps through it one block at a time, forwards or back. It shows which way each decision went, such as Count >= 3 → No, and the latest line of output. A CALL jumps to the procedure's own flowchart and comes back after Return.
If the program stops with an error, the replay ends on the block that failed, outlined in red. Very long runs show their first 5,000 steps. Changing the flowchart ends the replay; press Run again to follow the new version.
Edit in either view
Drag blocks from the palette onto the canvas, connect each block's bottom handle to the next block's top, and select a block to edit its text in the inspector. Blocks you add use the keywords of the exam syntax chosen in Settings.
Deleting a block other than a decision joins the blocks before and after it. Clear Canvas asks for a second click, because it empties the file.
A CASE option holds one statement. If you add a second block to an option, or change its condition to test something else, the chain is written as IF and ELSEIF instead so the code still compiles. Renaming a procedure's header line renames the procedure; update its CALL blocks too.
The flowchart still opens when the file doesn't compile. It then reads the file line by line, and a line it can't place, such as an IF with no ENDIF yet, appears unchanged in a Process block.