Chapter 3 of Starting FORTH says,
Now that you've made a block "current", you can list it by simply typing the word
L
. UnlikeLIST
,L
does not want to be proceeded by a block number; instead it lists the current block.
When I run 180 LIST
, I get
Screen 180 not modified
0
...
15
ok
But when I run L
, I get an error
:30: Undefined word
>>>L<<<
Backtrace:
$7F0876E99A68 throw
$7F0876EAFDE0 no.extensions
$7F0876E99D28 interpreter-notfound1
What am I doing wrong?
Yes, gForth supports an internal (BLOCK) editor. Start gforth
use blocked.fb
(a demo page)1 load
editor
words
will show the editor words,
s b n bx nx qx dl il f y r d i t 'par 'line 'rest c a m ok
type 0 l
to list screen 0 which describes the editor,
Screen 0 not modified
0 \\ some comments on this simple editor 29aug95py
1 m marks current position a goes to marked position
2 c moves cursor by n chars t goes to line n and inserts
3 i inserts d deletes marked area
4 r replaces marked area f search and mark
5 il insert a line dl delete a line
6 qx gives a quick index nx gives next index
7 bx gives previous index
8 n goes to next screen b goes to previous screen
9 l goes to screen n v goes to current screen
10 s searches until screen n y yank deleted string
11
12 Syntax and implementation style a la PolyFORTH
13 If you don't like it, write a block editor mode for Emacs!
14
15
ok
To create your own new block file myblocks.fb
use blocked.fb
1 load
editor
Then
use myblocks.fb
1 load
will show BLOCK #1 (lines 0 till 15. 16 Lines of 64 characters each) 1 t
will highlight line 1 i this is text
to [i]nsert into line 1flush
in order to write BLOCK #1 to the file myblocks.fb
For more information see, gForth Blocks