home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / jukemb10.zip / dir2dat.nrx < prev    next >
Text File  |  1997-05-24  |  768b  |  37 lines

  1. /* NetRexx file */
  2.  
  3. import RXFile
  4.  
  5. dirlist = Rexx[]
  6. rxWork = RXFile()
  7. rxOut = RXFile()
  8. maximum = Rexx 0
  9. new = int
  10. i = int
  11.  
  12. dirlist = rxWork.filetree(".")
  13. rxWork.delete("newdb.dat")
  14.  
  15. say "Counting maximum length"
  16. loop i = 0 to (dirlist.length - 1)
  17.  new = dirlist[i].length
  18.  if new > maximum then
  19.   maximum = new
  20. end
  21. maximum = maximum + 2
  22.  
  23. rxOut.stream("newdb.dat", "c", "open")
  24.  
  25. say "Writing header"
  26. rxOut.lineout("newdb.dat", "Active record?|Title|")
  27. rxOut.lineout("newdb.dat", "NONE|ISAM00|")
  28. rxOut.lineout("newdb.dat", "1|" || maximum.strip() || "|")
  29.  
  30. say "Writing records"
  31. loop i = 0 to (dirlist.length - 1)
  32.  rxOut.lineout("Y|" || dirlist[i].right(maximum))
  33. end
  34.  
  35. rxOut.stream("c", "close")
  36. say "Done. Your db is named NEWDB.DAT"
  37.