en farfouillant sur mon disque dur à la recherche de la fonction eventwparam() que je n'ai pas trouvé , je suis tombé sur ce code , il à été écrit par un certain Sebi...
Procedure.s ListFiles(directory.s , filename.s, extension.s , directoryid.l )
If Right(directory,1)<>"\"
directory+"\"
EndIf
ExamineDirectory(directoryid,directory,"*.*")
dirid=NextDirectoryEntry()
While dirid
Select dirid
Case 1
file.s=DirectoryEntryName()
this_extension.s=LCase(GetExtensionPart(file))
this_filename.s=LCase(Left(file,Len(file)-Len(this_extension)))
If Len(this_extension)
this_filename=Left(this_filename,Len(this_filename)-1)
EndIf
If this_extension=extension Or extension="*"
If this_filename=filename Or filename="*"
file.s=directory+DirectoryEntryName()
;file contains the full path and filename
;you must insert here what to do with the file
Debug file
EndIf
EndIf
Case 2
If DirectoryEntryName()<>"." And DirectoryEntryName()<>".."
ListFiles(directory+DirectoryEntryName()+"\",filename,extension,directoryid+1)
UseDirectory(directoryid)
EndIf
EndSelect
dirid=NextDirectoryEntry()
Wend
ProcedureReturn ""
EndProcedure
Debug "all txt-files in c:\windows\"
ListFiles("c:\windows","*","txt",0)
Debug ""