home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / input / exam05.dba < prev    next >
Encoding:
Text File  |  1999-08-25  |  1.1 KB  |  55 lines

  1. Rem * Title  : File System View
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ===========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 5
  6. rem ===========================================
  7. rem This program is a file system searcher
  8. rem -------------------------------------------
  9.  
  10. rem Clear the screen
  11. cls
  12.  
  13. rem Find current directory
  14. mydir$=get dir$()
  15.  
  16. rem Current directory can also be changed
  17. set dir mydir$
  18.  
  19. rem Show user current directory
  20. print "Directory to scan is ";mydir$
  21.  
  22. rem Begin search for files in current working directory
  23. find first
  24.  
  25. rem Create array and index variable
  26. dim item$(100)
  27. items=1
  28.  
  29. rem begin repeat loop
  30. repeat
  31.  
  32. rem add to item array if file found
  33. if get file type()=0
  34. item$(items)=get file name$()
  35. items=items+1
  36. endif
  37.  
  38. rem Find next file in current working directory
  39. find next
  40.  
  41. Rem Repeat loop until no more files in current working directory
  42. until get file type()=-1
  43.  
  44. rem List files within array
  45. print "Files in current directory:"
  46. for t=1 to items-1
  47. print item$(t)
  48. next t
  49.  
  50. Rem Delete array from memory
  51. undim item$()
  52.  
  53. rem End the program
  54. end
  55.