home *** CD-ROM | disk | FTP | other *** search
- \ VIEW.SEQ Viewing code for ZF. by Tom Zimmer
-
- only forth also definitions hidden also
-
- : NAME>PAD ( A1 --- PAD )
- >r r@ ys: ?cs: pad r> yc@ 31 and 1+ cmovel \ move name
- pad c@ 31 and pad c! \ clip count
- pad count + 1- dup c@ 127 and swap c! \ mask last ch
- PAD ;
-
- hidden definitions
-
- : files_set ( --- )
- ['] files >body HERE 1000 + #THREADS 2* CMOVE ;
-
- : 1file ( --- false | nfa )
- HERE 1000 + #THREADS LARGEST DUP
- if DUP L>NAME >r Y@ SWAP ! r>
- else nip
- then ;
-
- 0 value maxname
- 0 value maxcfa
-
- forth definitions
-
- : >viewfile ( cfa --- offset a1 )
- >r files_set off> maxcfa off> maxname
- begin 1file dup
- while r@ 1+ over name> u>
- if dup name> maxcfa u>
- if dup =: maxname
- dup name> =: maxcfa
- then
- then drop
- repeat drop r> >view y@
- maxname name>pad ;
-
- : LOAD ( n1 --- ) \ n1 is the line number to load from
- depth 1 < if 1 then \ default to line 1
- ?fileopen
- dup>r >line \ move to line n1
- cr ." Loading.."
- <load>
- r> =: loadline ;
-
- ' fload alias include \ make an alias that does the same thing as
- \ FLOAD.
-
-