FF.GetFilePath

Previous  Next

 

strPath = FF.GetFilePath( hHandle AS HANDLE, 

                          nIndex  AS INTEGER ) AS INTEGER

 


 

Returns the complete file path for the specified index.  The files found are sorted by the sort option specified in FF.Open.  Note that the base of the index depends on your OPTION BASE setting.

 

Example:

 

OPTION BASE 1

 

$LIBRARY "MyBASIC2_ExtLib"

$INCLUDE "MyBASIC2_ExtLib"

 

DIM hFF AS HANDLE

DIM nFiles AS INTEGER

DIM i AS INTEGER

DIM tmpFile AS STRING

 

CLS

 

' Folder to Search

CONST cFolder = "D:\Tech\Projects\COMMON\MyBASIC2\CodeTemplates"

 

' Open the File Finder and search for Code Template files

hFF = FF.Open( cFolder, "*.ct2", TRUE )

 

' Find all "normal" files

nFiles = FF.Find( hFF, EL_FF_NormalFiles )

 

' Print Result of Search

FOR i = 1 TO nFiles

  PRINT FF.GetFilePath( hFF, i ),

ENDFOR

 

PRINT ,

PRINT "Total File(s) "; FF.GetFileCount( hFF ),

 

' Close the File Finder

FF.Close( hFF )

 

END