! ! Brad Merrill ! 26-Apr-84 ! ! This is a minor reworking of Phil Budne's CX PCL program. The syntax ! is slightly changed to be reminiscent of the Tops-10 style of PATH. ! ! String Old_CD; ! < "POP" one directory level ! > "PUSH" to a subdirectory ! ^ "home" Command Path; begin string c, old, res; integer i, j, ic; external string Old_CD; parse noise "to directory"; c = $ConnectedDirectory; parse( eol (help "Confirm, to connect to previous directory"): begin c = Old_CD; goto zap; end; token ">" (help ">, to push to a Sub-Directory"): Parse( Field (Help "Sub-Directory"): if $atom <> "" then begin i = $search(c,">"); c = c[1:i-1] + "." + $atom + ">"; end; ); token "<" (help "<, to pop a directory level"): begin j = 0; do begin i = j; j = $search(c,".",i+1); end while j > 0; if i = 0 then abort "Cannot Pop"; c = c[1:i-1] + ">"; end; token "^" (help "^, to connect to LOGIN directory"): begin c = ""; goto cnf; end; directory(help "name of a directory to connect to"): begin c = $atom; goto cnf; end; ); !Parse lop: parse( eol: goto zap; token ">" (Help ">, to push to a Sub-Directory"): Parse( Field (Help "Sub-Directory"): if $atom <> "" then begin i = $search(c,">"); c = c[1:i-1] + "." + $atom + ">"; end; ); token "<" (help "<, to pop a directory level"): Begin j = 0; do begin i = j; j = $search(c,".",i+1); end while j > 0; if i = 0 then abort "Cannot Pop"; c = c[1:i-1] + ">"; end; ); goto lop; cnf: parse eol; zap: ! ****** TRY AND VERIFY DIRECTORY HERE ****** old = $ConnectedDirectory; show: docommand "ORIGINAL CONNECT " + C to res; if $search(res,"?") <> 0 then begin display res; exit; end; display $CRLF + " " + Old + " => " + $ConnectedDirectory + $CRLF; if old <> Old_CD then if old <> $ConnectedDirectory then Old_CD = old; End;