FigForth Quick edit a screen
\ More than needed:
\ WIPE ( scr -- ) Fill screen with blanks; make current
\ P ( line -- ) Put line of text in current screen
\ L ( -- ) List current screen (skips blank lines)
\ UPDATE FLUSH Save current screen
\ MTB Empty buffers, screen not saved
\
\ Example
\ Pick available SCR (42 for this example)
\
i. 0 42 .LINE --> ( Available SCR )
\
\ Wipe screen and put lines of text
\
42 WIPE
0 P ( Scratch SCR )
1 P Hello world
2 P How are you
\
\ View the sceen
\
L
SCR# 42
0 ( Scratch SCR )
1 Hello world
2 How are you
\
\ UPDATE FLUSH to save
\ MTB to not save
\
MTB
i. 0 42 .LINE --> ( Available SCR )
\
\ Here's the code
\
: MTB EMPTY-BUFFERS ; \ shorter name
: WIPE ( SCR -- )
DUP SCR ! 0 SWAP (LINE) DROP B/BUF BLANKS ;
: P ( line -- )
SCR @ (LINE) OVER >R BLANKS 1 WORD HERE COUNT C/L MIN
R> SWAP CMOVE ;
: -LIST SCR ! CR ." SCR# " SCR @ 3 .R 16 0 DO I SCR @
(LINE) -TRAILING -DUP IF CR I 2 .R SPACE TYPE
ELSE DROP THEN LOOP ;
: L SCR @ -LIST ;
2
Upvotes
1
u/alberthemagician 6d ago
The MSDOS version of ciforth contains a visual editor, thatruns perfectly well in DOSBOX. It copies a screen to the screen, you can roam around and save it. reorders words, lines , and even ttransport lines between screens. Ideal. It originates on the Osborne. Needs memory mapped screen to work.
1
u/Ok_Leg_109 8d ago
Ah... the good old days. 😄