home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1879 / popd.com < prev    next >
Encoding:
Text File  |  1990-12-28  |  539 b   |  17 lines

  1. $! popd.com - pop one or more directories from stack
  2. $
  3. $ if f$type(dir_stack) .eqs. "" then dir_stack :== ""
  4. $ if f$type(p1) .nes. "INTEGER" then p1 = 1    ! default # to pop: 1
  5. $ if p1 .lt. 0 then p1 = - p1
  6. $ if dir_stack .nes. "" then goto loop
  7. $   write sys$output "Directory stack empty"
  8. $   exit
  9. $loop:
  10. $   newdir = f$element(0," ",dir_stack)
  11. $   dir_stack == dir_stack - newdir - " "
  12. $   p1 = p1 - 1
  13. $   if p1 .gt. 0 .and. dir_stack .nes. "" then goto loop
  14. $ set def 'newdir
  15. $ if f$type(dirs) .eqs. "" then dirs :== show default
  16. $ dirs
  17.