GetDirFolder$
FolderName = GetDirFolder$(Index)
 
Parameters:

    Index = The index of the folder name you wish to retrieve
Returns:

    FolderName = The grabbed folder name
 

      The GetDirFolder$ function will only return filenames from the ReadDir file list.



FACTS:


      * You can check the type of file that stored in the ReadDir list by using the GetDirFileType function. This will return if the queried item, is a file or folder name.




Mini Tutorial:


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

  
; Read and sort the Files/Folder names in the
; current directory
  ReadDir CurrentDir$(),"",0,1
  
  
; Display a message
  Print "Filenames Only"
  Print "-----------------------"
  
; List all the FILENAMES within ReadDir file list
  For Files=0 To GetDirSize()-1
   ; CHeck if the file at this position in the ReadDir
   ; list, is a filename
     If GetDirFileType(Files)=1
        Print GetDirFile$(files)
     EndIf
  Next
  
; display a blank line
  Print ""
  
; Display a message
  Print "Folder Names Only"
  Print "-----------------------"
  
; List all the FILENAMES within ReadDir file list
  For Files=0 To GetDirSize()-1
   ; Check if the file at this position in the ReadDir
   ; list, is a filename
     If GetDirFileType(Files)=2
        Print GetDirFolder$(files)
     EndIf
  Next
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  



This example would something like this.

  
  Filenames Only
  -----------------------
  Main.pba
  Project1.pba
  Project1.pbr
  Temp.Project
  Temp.Source
  
  Folder Names Only
  -----------------------
  .
  ..
  

 
Related Info: GetDir$ | GetDirFile$ | GetDirSIze :
 


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