home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY4 / TTDIR1.ZIP / TTDIR105.DOC < prev    next >
Text File  |  1990-11-24  |  2KB  |  52 lines

  1.  
  2. PowerBasic Directory Function:  Version 1.05   November 24, 1990
  3.  
  4.  
  5. What is the program:
  6.  
  7.     The files in this archive use the Directory function of PowerBasic
  8.     2.10.  I have added a sub-routine to read a directory along with
  9.     additional information about each file in that directory.
  10.  
  11.  
  12. How it works:
  13.  
  14.     The heart of the program is the 'DIR$' function included in the
  15.     PowerBasic 2.10 package.  I used this as the base for the GetDirectory
  16.     functions.  When I ran a test call to get the 'DTA' after doing a
  17.     'DIR$' I found that the DTA area had all of the additional information
  18.     about the file.  Using this fact I wrote a sub-routine to get a
  19.     complete directory.
  20.  
  21.     The sub-routine in 'TTDIR100.BAS' is the first draft of this
  22.     sub-routine.  All of the information about the directory is stored in a
  23.     string array.
  24.  
  25.     The sub-routine in 'TTDIR101.BAS' is the second draft.  I corrected a
  26.     problem in calculating the size of the file.  Also, I found out that I
  27.     could place the call to get the 'DTA' outside of the loop reading the
  28.     directory.
  29.  
  30.     The sub-routine in 'TTDIR105.BAS' is the latest draft.  I placed all
  31.     text information into one string array.  Also, I moved the file date
  32.     and time into a separate integer array and the file size into a third
  33.     separate array.  I did this to see if using integer arrays were faster
  34.     than appending everything into a string array.  There should be a
  35.     program called 'TTEST5.BAS' that will call all of the sub-routines to
  36.     show the difference in speed.
  37.  
  38.     If you don't have PowerBasic you still can use these program.  Just
  39.     replace the first call to 'DIR$' with the DOS 'FINDFIRST' function and
  40.     the second call to 'DIR$' with the DOS 'FINDNEXT' function.
  41.  
  42.     The sub-routines themselves have comments on the parameters expected.
  43.     If you have any questions, comments, for suggestions on this subroutine
  44.     you can reach me on CompuServe.  My ID is 72540,2315.
  45.  
  46.  
  47.  
  48.  
  49. Thanks
  50.       Thomas Traynor
  51.       72540,2315
  52.