Skip to content

Edit and Trace Windows

Edit

An Edit window can be opened in any of the following ways:

  • Enter )ED <item name> in the interactive session
  • Enter ⎕ED '<item name>' in the interactive session
  • Press Shift+Enter (can be configured via Edit > Preferences> Shortcuts > ED) while the text cursor is on or adjacent to any item name
  • Double-click on or adjacent to an item name (can be toggled via Edit > Preferences > Trace/Edit > Double click to edit)

If the object name does not already exist, then it becomes a function or operator. Different types can be explicitly specified using the )ED or ⎕ED options – see )ED or ⎕ED in the Dyalog APL Language Reference Guide.

A Trace window can be temporarily changed into an Edit window by pressing Shift+Enter or clicking while the text cursor is not on or adjacent to any name.

To save your changes and exit the Edit window, press Esc (can be configured via Edit > Preferences> Shortcuts > EP) or click .

To exit the Edit window without saving, press Shift+Esc (can be configured via Edit > Preferences> Shortcuts > QT).

Trace

The Trace window aids debugging by enabling you to step through your code line by line, display variables in Edit windows and watch them change as the execution progresses.

A Trace window can be opened from the Session window by pressing Ctrl+Enter (can be configured via Edit > Preferences > Shortcuts > TC) after typing an expression.

Note

By default, Dyalog is also configured to initiate an automatic trace whenever an error occurs, that is, the Trace window opens and becomes the active window and the line that caused the execution to suspend is selected. This is controlled by the interpreter configuration parameter TRACE_ON_ERROR. For information on configuration parameters, see the Dyalog Installation and Configuration Guide for your operating system:

To resume execution, press the |> button (can be given a keyboard shortcut via Edit > Preferences> Shortcuts > RM).

To resume execution until the current function returns, press the |¯\. button (can be given a keyboard shortcut via Edit > Preferences> Shortcuts > BH).

To cut back the stack one level, press Esc (can be configured via Edit > Preferences> Shortcuts > EP) or click .

New Edit and Trace windows can be floating rather than docked by selecting the Floating windows checkbox in the Trace/Edit of the Preferences dialog box.

Docked or not, the Session, Edit and Trace windows form a closed loop for the purpose of navigation: - to make the next window in this loop the active window, press Tab (can be configured via Edit > Preferences> Shortcuts > TB) - to make the previous window in this loop the active window, press Shift+Tab (can be configured via Edit > Preferences> Shortcuts > BT)

You can close all Trace/Edit windows without clearing the stack by selecting the Window > Close All Windows menu option or using 2023⌶.