Watch the video: Browse code
The code shown in the editor has three types:
variable name name ? set to "Alice " value or expression ? 0 name name ? = "Alice " value or expression ? # variable definition 0 var name name ? = "Alice " value or expression ? ;0 Dim name name ? = "Alice " value or expression ? ' variable definition 0 var name name ? = "Alice " value or expression ? ;0 # A program to investigate the Collatz Conjecture comment ? # A program to investigate the Collatz Conjecture comment ? // A program to investigate the Collatz Conjecture comment ? ' A program to investigate the Collatz Conjecture comment ? public class Global {
// A program to investigate the Collatz Conjecture comment ?
} 


print(any)
Code does not parse as Elan.print(any)
Code does not parse as Elan.print(any)
Code does not parse as Elan.print(any)
Code does not parse as Elan.print(any)
Code does not parse as Elan.set set set set set instruction.Comments and new code prompts are not instructions. They do not alter the program's behaviour, though they are treated by the editor like instructions.
| To... | Keyboard shortcut | Mouse gesture | Notes |
|---|---|---|---|
| select an arbitrary instruction | click on the initial keyword of the instruction or its number | ||
| select the next instruction | ↓ | limited to the current block of instructions | |
| select the previous instruction | ↑ | limited to the current block of instructions | |
| select the first instruction at the current level of indentation | Home | ||
| select the last instruction at the current level of indentation | End | ||
| select the outer instruction containing the current one | ← | ||
| select the first inner instruction contained by the current one | → | ||
| add the next instruction to the current selection | Shift+↓ | Shift, and click on the initial keyword of the instruction or its number | limited to the current block of instructions |
| add the previous instruction to the current selection | Shift+↑ | Shift, and click on the initial keyword of the instruction or its number | limited to the current block of instructions |
| toggle outlining on an individual instruction | select the instruction then Ctrl+o | double-click on the initial keyword or instruction number | |
| toggle outlining for the whole program | Ctrl+O (same as Ctrl+Shift+o) | click the outline button |
Watch the video: Create New Instructions
When you have selected an instruction by clicking on its keyword (turning its background blue), some immediate actions are available from its context menu which is opened either by clicking the right mouse button on the keyword, or by keying Ctrl+m. The commonest context menu shows these options, any one of which may then be clicked on to do the action:
The context menu shows only those actions which are relevant to that instruction in its context.
The following is a list all possible menu items with key equivalents where applicable:
| do | undo | keyboard |
|---|---|---|
| insert new code below | Enter | |
| insert new code above | Shift+Enter | |
| delete | Ctrl+Delete or Ctrl+Backspace | |
| move up | Ctrl+↑ | |
| move down | Ctrl+↓ | |
| cut for internal use | Ctrl+x | |
| copy for internal use | Ctrl+c | |
| ghost | unghost | |
| set breakpoint | clear breakpoint | |
| clear all breakpoints | ||
| copy for external use | ||
| make private | make public | Ctrl+p (toggle) |
| To... | Keyboard shortcut | Mouse gesture | Notes |
|---|---|---|---|
| select any field within an instruction | click anywhere on the text, or placeholder, for that field. | Text cursor will be placed at the end of the field | |
| select the first field in a selected instruction | Tab | ||
| select the next field in the same instruction | Tab | will cycle through the fields and back to the whole instruction. | |
| select the previous field in the same instruction | Shift+Tab | will cycle through the fields and back to the whole instruction. | |
| select specific text within a field | Shift+← or → | click and drag across the desired characters | |
| select all text within a field | Ctrl+a | ||
| position text-cursor at the start of a selected field | Home | click anywhere within the selected field | |
| position text-cursor at the end of a selected field | End | click anywhere within the selected field | |
| go from the last field to the next instruction | Enter |
If there is already a new code prompt where you want to insert an instruction, refer to the description under Browse code above.
Otherwise, select an instruction adjacent to where you want to add the new one and either:
| To delete | Keyboard shortcut | Notes |
|---|---|---|
| one or more (adjacent) existing instructions | select the instructions then Ctrl+Delete, Ctrl+Backspace or Ctrl+x | deleting a compound instruction will delete all its contained instructions |
| a just-created instruction | Backspace | this works only if no fields have been entered or 'child' instructions added |
| a new code prompt that is not needed | delete the same way as an instruction | |
| all new code prompts | Click on the Trim button or Alt+t | removes all new code prompts except in places where further instructions are required (for example so as not to leave an empty loop) |
The editor retains previous versions of your code in its stack, but only when it has been parsed as valid. The code is saved internally, and also to file if auto-save is selected.
| Action | Using the keyboard | Using the mouse |
|---|---|---|
| Undo previous changes | Ctrl+z | click on undo button |
| Redo previous undos | Ctrl+y | click on redo button |
Instead of being able to 'comment out' code that you wish to retain but not execute, there is a method for 'ghosting' sections of code with much the same effect, while leaving the ghosted code fully formatted.
Watch the video: Debugging programs
You can debug a running program with or without having set breakpoints.
| To... | Keyboard shortcut | Mouse gesture | Notes |
|---|---|---|---|
| debug a program, or resume debugging a paused program | Ctrl+g | Click on 'debug' button | disabled if there are any parse or compile issues. |
| pause a program that is running | Ctrl+u | Click on 'pause' button | enabled only when program is being debugged |
| step to the next instruction in a paused program | Ctrl+p | Click on 'step' button | enabled only then program is paused |
Whenever the program is paused, all named values (variables, parameters and constant values) that are currently in scope have their values automatically listed in the Info pane. This list may be browsed as follows:
| To... | Keyboard shortcut | Mouse gesture |
|---|---|---|
| navigate to a specific line in the list when paused | Tab, Shift+Tab | Click on the line |
| expand/collapse a specific name within the list | Enter | Click on the + or - at the start of the line |
Before clicking on debug you can set breakpoints at one or more instructions where you want execution to pause. A red flash symbol appears at every instruction that has a breakpoint defined..
When run using debug the program will automatically pause at every breakpoint, and the in-scope named values will be listed in the Info pane.
| To... | Keyboard shortcut | Mouse gesture |
|---|---|---|
| set a breakpoint on a selected instruction | Ctrl+m on a selected instruction keyword then select set breakpoint | right-click for context menu, then select set breakpoint |
| clear existing breakpoints | Ctrl+m on a selected instruction keyword, then select clear breakpoint or clear all breakpoints | right-click for context menu, then select clear breakpoint or clear all breakpoints |
Where a keyboard shortcut is shown with the Ctrl control key, users of Apple's macOS should use the ⌘ Command key instead.
There are two ways in which to change the colour scheme for users with CVD: