home *** CD-ROM | disk | FTP | other *** search
- \ ALLSPECS.SEQ Return all directories one at a time
-
- 4000 constant dirlenmax
- create dirlist dirlenmax 100 + allot
- 0 value dirlistlen
- 0 value dirptr
- 16 constant dirattribute
- handle dirshndl
- handle curhndl
- create startdir ," \" 64 allot
-
- create dirpad 1024 allot
-
- : nullcmove ( a1 a2 -- n1 )
- over 64 2dup 0 scan nip - dup>r nip cmove r> ;
-
- : dir>list ( a1 -- ) \ append a dir spec to list
- dirlistlen dirlenmax <
- if dirlist dirlistlen + >r
- curhndl count 3 - 0max r@ place
- r@ count + nullcmove r@ c+!
- r> c@ 1+ +!> dirlistlen
- else drop
- then ;
-
- : nulltype ( a1 -- )
- 12 2dup 0 scan nip - type space ?cr ;
-
- : +place ( a1 n1 a2 -- ) \ append a1 n1 to counted a2
- dup>r count + over r> c+! swap cmove ;
-
- : $getdirs ( a1 --- )
- dirshndl $>handle \ get directory spec
- dirpad SET-DTA
- dirshndl >nam findfirst
- begin 255 and 0=
- while dirpad 21 + c@ dirattribute =
- dirpad 30 + c@ '.' <> and
- if dirpad 30 + dir>list
- then findnext
- repeat ;
-
- long_branch
-
- : getdirs ( -- )
- dirlist dirlenmax 100 + erase
- startdir count dup 1+ =: dirlistlen dirlist place
- dirlist
- begin dup c@
- ?keypause
- while curhndl clr-hcb
- dup count curhndl place
- curhndl count + 1- c@ '\' <>
- if " \" curhndl +place
- then
- " *.*" curhndl +place
- \ curhndl count cr type space
- curhndl $getdirs
- count +
- repeat drop dirlist =: dirptr ;
-
- short_branch
-
- : nextdir ( -- a1 )
- dirptr dup count dup
- if + =: dirptr
- else 2drop
- then ;
-
-
-