home *** CD-ROM | disk | FTP | other *** search
- \ PATHSET.SEQ Words used to set the path of a file. by Tom Zimmer
-
- 0 constant flhndl \ plugged later
-
- : ?drive.extract ( handle --- drive-value )
- dup >nam 1+ c@ ascii : =
- if dup >r >nam c@ bl or 96 -
- r@ count 2- >r dup 2+ swap r> cmove
- r@ c@ 2- r@ c! r> count + off
- else drop 0 25 bdos 1+ then ;
-
- : ?drive.prepend ( drive-value handle --- )
- over 0=
- if 2drop
- else dup >r count >r dup 2+ r> cmove>
- 64 + r@ >nam c! ascii : r@ >nam 1+ c!
- r@ c@ 2+ r> c!
- then ;
-
- handle pathhndl
-
- : prepend.path ( handle --- f1 )
- pathhndl clr-hcb
- dup =: flhndl ?drive.extract >r
- flhndl >nam c@ ascii \ =
- if r> flhndl ?drive.prepend 0 exit then
- ascii \ pathhndl 1+ c! 64 pathhndl c!
- pathhndl 2+ r@ pdos ?dup if r> drop exit then
- pathhndl 1+ 64 0 \ determine path length
- do dup i + c@ 0= if i pathhndl c! leave then
- loop drop pathhndl c@ 1 >
- if ascii \ pathhndl count + c! pathhndl c@ 1+ pathhndl c!
- then flhndl c@ pathhndl c@ + 62 >
- if r> drop true exit
- then
- flhndl 1+ pathhndl c@ over + flhndl c@ cmove>
- pathhndl count flhndl 1+ swap cmove
- pathhndl c@ flhndl c@ + flhndl c!
- r> flhndl ?drive.prepend 0 ;
-
- ' PREPEND.PATH IS PATHSET
-
- handle viewpath viewpath prepend.path drop
-
-