home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / GLIB14.ZIP / DIR.SUB < prev    next >
Encoding:
Text File  |  1988-02-06  |  1.0 KB  |  27 lines

  1. '  **********  READ ME  ***********
  2. ' Specifically, it fills the passed FIL$ array with filenames matching
  3. ' the passed mask$.  This is provided to you as a way to provide upward
  4. ' GLIB compatibility: A QB3 program that called DIR can VERY easily call
  5. ' the separate routines used in the QB4 version.
  6. '
  7. '  Written for TAB setting of 5, this is essentially the 'GUTS' to the
  8. '  DIR   SUB...END SUB in the main module
  9.  
  10.      DEFINT A-Z               ' gotta use ints espcially for FILCNT
  11.      STATIC j, tfil$
  12.  
  13.      CALL filcnt(mask$, quan)          ' calling again here, prevents us from
  14.                       '   having to pass QUAN as a parm
  15.  
  16.      tfil$ = SPACE$(12)           ' Save space
  17.      CALL firstf(mask$, tfil$)          ' Get first matching file
  18.  
  19.      fil$(1) = RTRIM$(tfil$)          ' move that many chars to array
  20.  
  21.     FOR x = 2 TO quan
  22.        tfil$ = SPACE$(12)          ' prevent bleed thru from longer filename
  23.        CALL nextf(tfil$)          ' Find Next Matching File
  24.        fil$(x) = RTRIM$(tfil$)          ' store in array
  25.     NEXT x
  26.  
  27.