home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / BUILDER.ZIP / APATH.BLD next >
Text File  |  1992-12-02  |  905b  |  46 lines

  1. string s,t,y
  2. if paramcount <2 goto error
  3. if "%1"<>"-" goto addit
  4. s:=Uppercase "%2"
  5. :deleteit
  6. t:=s
  7. s:=""
  8. for %%p in "%path%" do parsepath
  9. set "path"=s
  10. exit 0
  11. :addit
  12. s:=Uppercase "%1"
  13. t:=s+";"
  14. if "%path%;" contains t goto error2
  15. set "path" = t+"%path%"
  16. exit 0
  17. :error
  18. say
  19. say "APATH Ver 2.0     THE HYPE UTILITIES    written in BUILDER"
  20. say "by David Rude and Doug Amaral"
  21. say
  22. say "Correct usage is : APATH <-> <path name>"
  23. say "where <path name> is the path specification to append to your current path."
  24. say "<-> deletes the path specification from the path."
  25. say
  26. say "Current Path = %path%"
  27. exit 1
  28. :error2
  29. say
  30. say s+" is already on the current path."
  31. say
  32. say "Would you like to remove it ? (Y/N)";
  33. GETYN
  34. if DOSErrorLevel==1
  35. s:=Uppercase "%1"
  36. say
  37. say "Removing %1 from the current path"
  38. goto deleteit
  39. end
  40. exit 2
  41.  
  42. sub parsepath
  43. y:="%%p"
  44. if (t<>y) s:=s+y+";"
  45. end
  46.