GetDirSize
NumbOfFiles = GetDirSize()
 
Parameters: NONE
Returns:

    NumbOfFiles = The Number of files currently in the Read Dir list
 

      The GetDirSize function returns the number of files that are currently stored within the ReadDir's commands internal filename list.



FACTS:


      * The number of files in the ReadDir list will also include any directories that were located too.

      * GetDirSize will return a zero if the file list is empty



Mini Tutorial:


      This example reads and sorts all the files in the current directory, then displays this list of files to the screen.

  
; Get the current directory
  ThisDir$=CurrentDir$()
  
; Read and sort the Files/Folder names in the
; current directory
  ReadDir ThisDIr$,"",0,1
  
; Display the number of files located
  Print "Files in Dir list:"+Str$(GetDirSize())
  
; List all the files in ReadDir file list
  For Files=0 To GetDirSize()-1
     Print GetDir$(files)
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would something like this.

  
  Files in Dir List:4
  .
  ..
  MyFile.pbp
  MyOtherFile.pbp
  

 
Related Info: GetDir$ | GetDirFile$ | GetDirFolder$ :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com