Block Line Editor

The block line editor supplied is the familiar old fig-Forth line editor, complete with a few extra commands.

The editor comes as an optional loadable component, and can be loaded with

    S" lineedit.fth" INCLUDED

This file contains the ANS Forth words LIST and SCR from the Block Extensions word set and EDITOR from the Programming Tools Extensions word set, plus the words detailed below. These are all part of the EDITOR vocabulary, which is best entered with:

    ALSO EDITOR

to ensure that the FORTH vocabulary remains in the search order.


Screen Commands

n LIST
List screen n and select it for editing as the current screen.
n CLEAR
Clear screen n with blanks and select it for editing as the current screen.
L
List the current screen. Then display the current line, marking the cursor position with an underscore character.
WIPE
Clear the current screen to blanks and list it.

Line Editing Commands

n D
Delete line n by moving all following lines up by one line. Hold the original contents of line n in PAD.
n E
Erase line n with blanks.
n ED
Edit line n using the standard ACCEPT line-editing facilities.
n H
Hold line n in PAD.
n I
Insert the contents of PAD in line n and move the original line n and all following lines down by one line (line 15 is lost).
n P text
Put text into line n, overwriting the original contents.
n R
Replace line n with the contents of PAD.
n S
Spread line n by moving it and all following lines down by one line. Line n is erased with blanks, and line 15 is lost.

Cursor Movement Commands

B
Used after F to move the cursor back to the start of the found text. Then displays the current line, marking the current position with an underscore character.
n M
Move the cursor by the signed number n. Then display the current line, marking the current position with an underscore character.
n T
Type line n and copy its contents to PAD. Move the cursor to the start of line n.
TOP
Move the cursor to the start of line 0.

String Editing Commands

C text
Copy text to the current line at the cursor position and move the rest of the line to the right. Then display the current line, marking the cursor position with an underscore character.
F text
Find text starting at the cursor position. If text is found, move the cursor to the end of the found text. Then display the current line, marking the cursor position with an underscore character. Otherwise move the cursor to the start of line 0.
N
Used after F to find the next occurrence of the found text.
TILL text
Find text starting at the cursor position. If text is found, delete all characters from the cursor position up to and including text by moving the remaining characters to the left and filling up the line with blanks. Then display the current line, marking the cursor position with an underscore character.
X text
Find text starting at the cursor position. If text is found, delete it by moving the remaining characters to the left and filling up the line with blanks. Then display the current line, marking the cursor position with an underscore character. Otherwise move the cursor to the start of line 0.

Utility Commands

u1 u2 COPY
Copy the contents of block u1 to block u2.
u1 u2 INIT
Clear blocks u1 thru u2 with blanks.
u1 u2 INDEX
Index blocks u1 thru u2 by displaying each block number followed by the first line of the block.
u1 u2 n BINS
Insert n blank blocks at u1, moving all blocks u1 thru u2 up to make sufficient space.
u1 u2 n BDEL
Delete n blocks beginning at u1, moving all remaining blocks up to u2 down to close the gap, filling blocks at the end with blanks.

More about CamelForth

Back to the Z88 home page