GetDir$
FileName = GetDir$(Index)
 
Parameters:

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

    FileName = The grabbed filename
 

      The GetDir$ function returns the filename or folder name stored at this position in the ReadDir file list.



FACTS:

      * None



Mini Tutorial:


      This example reads and sorts all the files in the current directory, then displays the 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 that are stored within
; the 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: GetDirFile$ | GetDirFolder$ | GetDirSIze :
 


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