
The keys that move the cursor about in ed, and the two that get you out.
S10 uses a handful of these. The rest are here so that you are not stuck when the one you want is not the one S10 taught you.
| Press | What happens |
|---|---|
| CTRL-C | Keep the changes. The procedure is redefined and you go back to ? |
| ESC | Throw the changes away. Prints Stopped! and goes back to ? |
Both leave the editor. There is no way to save without leaving.
The arrow keys do nothing in the editor. At the ? prompt they give you
[ and ], but once ed is open they neither type brackets nor move the
cursor. Everything below uses CONTROL instead.
| Press | Moves the cursor |
|---|---|
| CTRL-H | One character left |
| CTRL-D | One character right |
| CTRL-A | To the start of the line |
| CTRL-E | To the end of the line |
| CTRL-J | Down one line |
| CTRL-K | Up one line |
When ed opens, the cursor is at the end of the first line - after the
procedure's name, not at the start of it.
| Press | What happens |
|---|---|
| CTRL-Y | Deletes the character before the cursor |
| typing | Inserts at the cursor. Nothing is ever overwritten |
The editor is always inserting. There is no overtype mode to get stuck in, and nothing you type will replace what is already there - to replace something you delete it first and then type.
Say to star is on the screen and you want the body, on the second line,
to turn by 72 rather than 144:
to star
repeat 5 [fd 60 rt 144]
end
144] - the closing bracket counts.72].Count the deletes carefully. Three would leave rt 1, and typing 72] after
that gives you rt 172], which is a different shape and not an obvious mistake
to spot afterwards.
Deleting from the end of the line and retyping is usually less fiddly than counting characters to get to the middle of one.
The manual for Dr Logo lists around twenty more control codes, covering things like deleting to the end of a line, opening a blank line, paging up and down through a long definition, and recalling text you have just deleted.
They are not listed here because they have not been tried. Everything in this appendix has been run on the machine and does what it says.