home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilst / tidydir / TidyDir (.txt) < prev   
Encoding:
RISC OS BBC BASIC V Source  |  1995-12-02  |  1.1 KB  |  55 lines

  1.  TidyDir 1.00
  2.  (c) 02-Dec-1995 Ian Clark
  3.  This prog Freeware
  4.  Feel free to butcher this code however you like, but please don't
  5.  distribute butchered code!
  6. $+" at line "+
  7.  "TidyDir 1.00 
  8.  1995 Ian Clark of RoosterPD"
  9.  '"This short program scans a directory and tidies up file names."
  10.  "Dir to scan=>"dir$
  11. Scan(dir$)
  12. Scan(path$)
  13.  more%,num%,pressed%,ptr%,scan$,mem%,type%,x%,ftype%
  14.  mem% 800
  15. more%=0
  16. &C,12,path$,mem%,16,more%,800,"*" 
  17.  ,,,num%,more%
  18. ptr%=mem%
  19.  num% 
  20.  x%=1 
  21.  num%
  22. type%=ptr%!16
  23. ptr%+=24
  24. scan$=
  25. St(ptr%)
  26. ptr%=((ptr%+4)>>2)<<2
  27. "OS_CLI","Rename "+path$+"."+scan$+" "+path$+"."+
  28. Format(scan$)
  29.  type%>=2 
  30. Scan(path$+"."+scan$)
  31.  more%=-1
  32.  ptr%)
  33.  ?ptr%>25 
  34. tx$<255
  35. tx$+=
  36. (?ptr%):ptr%+=1
  37. Format(st$)
  38.  out$,char%,x%
  39. char%=
  40. st$,1))
  41.  char%>96 
  42.  char%<123 char%-=32
  43. out$=
  44. (char%)
  45.  x%=2 
  46. (st$)
  47. char%=
  48. st$,x%,1))
  49.  char%>64 
  50.  char%<91 
  51.  char%+=32
  52. out$+=
  53. (char%)
  54. 8    =out$
  55.