Running and the Console

Running

Press Run on the toolbar, F5 or Ctrl+E. While a run is going, the button reads Stop, and Stop or Shift+F5 ends it. A run belongs to its document: switching tabs while it goes leaves it going, and closing the document ends it.

What runs depends on the graph:

  • A Flows graph runs its active nodes and everything they depend on, and nothing else.
  • A Function runs every node, from its Input to its Output.
  • In Interpreted mode, on a Routine, an Events graph or a state machine, Run runs the graph on screen; anywhere else, it runs the document's entry graph - the one the outline marks entry.
  • In Compiled mode, Run always runs the entry graph.

When the run ends, the status bar says how it went, and the Properties panel turns to its Run face: Finished or Failed, how long it took and in which mode, the problems that stopped it, and its Run log - what it printed. A run never changes the document; the next run starts from what is on the canvas.

To see a node's result at full size after an interpreted run, select it and press Alt+Enter, or right-click it and choose Open preview in window: it opens in a window of its own. Before a run there is nothing to show, and the status bar says Run the graph first; there is nothing to preview yet.

The two run modes

The switch on the toolbar runs the document one of two ways. Each tab has its own setting, and a document opens on Interpreted; the status bar names the mode beside its message. Hover over either half of the switch for the difference in a few lines.

Interpreted Compiled
How it runs Walks the graph node by node Builds the document into a program first, then runs that
Speed Starts at once; slower on heavy work Takes a moment to build, then runs far faster
What Run starts The Routine, Events graph or machine on screen, else the entry graph Always the entry graph
On the canvas Every node that ran shows done, and a preview of what it produced where there is something to show; a failing node is outlined in red Nothing: a compiled program reports only what it printed and returned
The status bar 4 nodes in 99 ms Ran compiled in 361 ms
The console Each line names the node that printed it Each line names the run
Debugging Breakpoints, pausing and stepping None - see Debugging
Stop Stops before the next node or statement The program cannot be interrupted; its result is discarded when it lands

Work interpreted while you build and debug, and switch to compiled when a run is heavy - a long loop, a large image, a big table - or to check that the program behaves as it will when it runs outside the editor, where it runs compiled by default (see Exporting a program). A document, its data members and its starting values behave the same both ways.

The first program after a compiled run: the switch on Compiled, no results under the nodes, the Run face reading Finished and Compiled, and the console's line 7 attributed to the run

Active nodes

On a Flows graph, a run starts from the nodes marked Active and runs only what they need. Select a node and press Space to mark it active or not, or use the Active switch in its Properties. The line above the canvas counts them - 1 active · 4 will run - and the nodes a run would not touch are dimmed. A run with nothing active reads Nothing ran (no active nodes), in either mode.

Cached results

A slow node - one that loads a large file, or renders - can keep its result between interpreted runs. Select it and press Shift+Space, or turn on Cache result in its Properties: the next runs reuse what it produced and skip it and everything before it, until something it depends on changes. The status bar counts what was reused - 1 node in 5 ms · 10 reused. Switching it on right after an interpreted run keeps that run's result at once. Turn it off and on again to recompute it on purpose, for example when the file it reads has changed.

The console

What a run prints - Print Line, Print, and anything else that writes - goes to the console dock under the canvas. The dock stays shut while a run prints quietly: the status bar counts the lines, a dot beside the count says there is something unread, and a short note appears over the canvas. It opens by itself when a run writes to standard error, fails, or waits for you to type something.

Open or close it with Ctrl+`, or by clicking the line count in the status bar. Drag its top edge to make it taller or shorter.

Along the top of the Console tab, from the left:

Control What it does
Follow Keep the newest line in view.
The category list Show All lines, or only the run's Output, its Standard error, or the Run errors - the failure that stopped it.
Filter lines Show only the lines containing what you type. Esc empties it.
Copy Copy the lines showing, with the full detail of a failure.
Clear Clear the console until the next run.

Each line carries the time it was printed and what printed it, between two rows that name the document the run was of, and the mode, and say when it finished. The console belongs to the run, not the tab: a run of one document that pauses or ends while another is in front still shows its lines. The lines can be selected and copied with Ctrl+C. The status bar's own message can be copied too: click it.

When a run asks for input

A node such as Read Line waits for a line of text. The dock opens on the console with an input row under the last line, and the status bar reads Waiting for input. Type and press Enter to send it. Shift+Enter starts a second line, and each line answers one read in turn. Ctrl+D ends the input, and Shift+F5 stops the run.

The other tabs

  • Locals and Call stack show where a paused run is - see Debugging.
  • Search (Ctrl+F) finds documents, graphs, nodes by title, name or value, members, comments and groups, in this document, the open ones or the whole workspace.
  • References lists every node that reads, sets or calls a member: right-click a data member's node, or a Get or a Set, and choose Find All References.
  • Terminal (Ctrl+Shift+`) is a command line in the workspace folder - see The window.