Moved Retro-Forth editor to generic sources

This commit is contained in:
Carsten Strotmann 2020-07-19 08:40:55 +02:00
parent 97f4e08b02
commit d2369b790f
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
\ Retro Forth Editor a simple forth-style editor use filename.fb :: open forth block file block# list :: list block v :: view current block x :: clear/zero block line# i text :: insert text at line line# d :: delete line n :: load next block p :: load previous block block# s :: load block e :: evaluate/load block \ RetroForth Editor for VolksForth 1/2 16 constant l/b : (block) scr @ block ; : (line) c/l * (block) + ; : row dup c/l -trailing type c/l + cr ; : .rows l/s 0 do i . row loop ; : .block ." BLOCK: " scr @ . space ; : +--- ." +---" ; : :--- ." :---" ; : x--- +--- :--- +--- :--- ; : --- space space x--- x--- x--- x--- cr ; : vb --- scr @ block .rows drop --- ; : .stack ." Stack: " .s ; : status .block .stack ; : v cr vb status ; --> \ RetroForth Editor for VolksForth 2/2 : v* update v ; : s dup scr ! block drop v ; : ia (line) + >r 10 parse r> swap move v* ; : i 0 swap ia v* ; : d (line) c/l bl fill v* ; : x (block) l/b c/l * bl fill v* ; : p -1 scr +! v ; : n 1 scr +! v ; : e scr @ load ; .( Retro Forth Editor loaded ) : x (block) l/b c/l * bl fill v* ; : p -1 scr +! v ; : n 1 scr +! v ; : e scr @ load ; .( RetroForth Editor loaded ) \ Retro Forth Editor a simple forth-style editor use filename.fb :: open forth block file block# list :: list block v :: view current block x :: clear/zero block line# i text :: insert text at line line# d :: delete line n :: load next block p :: load previous block block# s :: load block e :: evaluate/load block \ RetroForth Editor for VolksForth 1/2 19july2020 16 constant l/b : (block) scr @ block ; : (line) c/l * (block) + ; : row dup c/l -trailing type c/l + cr ; : .rows l/s 0 do i . row loop ; : .block ." BLOCK: " scr @ . space ; : +--- ." +---" ; : :--- ." :---" ; : x--- +--- :--- +--- :--- ; : --- space space x--- x--- x--- x--- cr ; : vb --- scr @ block .rows drop --- ; : .stack ." Stack: " .s ; : status .block .stack ; : v cr vb status ; --> \ RetroForth Editor for VolksForth 2/2 : v* update v ; : s dup scr ! block drop v ; : ia (line) + >r 10 parse r> swap move v* ; : i 0 swap ia ; : d (line) c/l bl fill v* ; : x (block) l/b c/l * bl fill v* ; : p -1 scr +! v ; : n 1 scr +! v ; : e scr @ load ; .( Retro Forth Editor loaded ) : x (block) l/b c/l * bl fill v* ; : p -1 scr +! v ; : n 1 scr +! v ; : e scr @ load ; .( RetroForth Editor loaded )

View File

@ -16,7 +16,7 @@ Screen 0 not modified
14 14
15 15
Screen 1 not modified Screen 1 not modified
0 \ RetroForth Editor for VolksForth 1/2 0 \ RetroForth Editor for VolksForth 1/2 19july2020
1 1
2 16 constant l/b 2 16 constant l/b
3 3
@ -38,7 +38,7 @@ Screen 2 not modified
2 : v* update v ; 2 : v* update v ;
3 : s dup scr ! block drop v ; 3 : s dup scr ! block drop v ;
4 : ia (line) + >r 10 parse r> swap move v* ; 4 : ia (line) + >r 10 parse r> swap move v* ;
5 : i 0 swap ia v* ; 5 : i 0 swap ia ;
6 : d (line) c/l bl fill v* ; 6 : d (line) c/l bl fill v* ;
7 : x (block) l/b c/l * bl fill v* ; 7 : x (block) l/b c/l * bl fill v* ;
8 : p -1 scr +! v ; 8 : p -1 scr +! v ;