home *** CD-ROM | disk | FTP | other *** search
- ( Loading .. Forth Line Editor - Davidsoft 1991 ) type cr
-
- : ^ 94 token ;
- ^ is a comment marker ^
-
- 0 variable maxpos
- ^ maxpos holds furthest position of a char in a line ^
-
- : showbuffer
- 128 0 do
- buffer i + c@
- dup 0=
- if
- drop { [0]} type leave
- else
- vdu
- then
- loop
- ;
-
- : clrbuffer 127 0 do 32 buffer i + ! loop ;
- ^ reset the buffer ^
-
- : isctrl 2dup 126 > swap 32 < or ;
- ^ push 1 to stack if is a ctrl char ^
-
- : mvf
- dup lbp @ buffer + c!
- lbp @ 127 <
- if
- 1 lbp +!
- lbp @ maxpos @ >=
- if
- lbp @ maxpos !
- then
- vdu
- else
- vdu 8 vdu
- then
- ;
-
- : mvb
- lbp @ 0>
- if
- 127 vdu
- 32 lbp @ buffer + c!
- -1 maxpos +!
- -1 lbp +!
- then
- ;
-
- : inline
- cr
- clrbuffer
- maxpos 0set
- lbp 0set
- begin
- get
- dup isctrl
- if
- dup 127 =
- if
- mvb drop
- else
- dup 27 =
- if
- quit
- else
- drop
- then
- then
- else
- mvf
- then
- 13 <>
- if while
- lbp @ buffer + c0set
- lbp 0set
- space
- ;
-
- ^ &8364 editv ! ^ ^ fix the inline reference - until FORTH inline works..^
-
- ' inline editv !
-