'= , = , = ; = , =, = , = ,= , = '2006 by ytwinky, MD #include "windows.bi" #include "vbcompat.bi" Declare Function FindFile(Folder As String, i, Ext As String="*") As String Width 90,30 Dim i=0 Dim As String FolderName, Ext Input"Enter foldername:", FolderName If FolderName="" Then FolderName="F:" 'Input"Extension you are looking for:", Ext If Ext="" Then Ext="*.*" 'this way you can even specify a filename :D Cls Print "FindFile V0.9001 2006 by ytwinky, MD" Print "Tnx to yetifoot for findfirstfile.bas" Print "Tested with FB 0.15b using FBIde 0.4.6" Print "Folder=";FolderName; " Ext=";Ext Print "Windows-Standard(Wait please..)" Print "Attr Filename" Ext=FindFile(FolderName, i, Ext) Print Ext &"Now you may dimension an array:i=" &Str(i) &"..or use pointers ;-))"; GetKey Function FindFile(Folder As String, byRef i, Ext As String=".*") As String Dim Plural(1) As String={"s", ""} 'Erst nach Ordnern suchen, dann nach Dateien Dim ffd As WIN32_FIND_DATA Dim Attr=0, s="" If Right(Folder, 1)<>"\\" Then Folder+="\\" Dim As HANDLE hFind=FindFirstFile(Folder &"*", @ffd) If hFind=INVALID_HANDLE_VALUE Then s+="Ooops, no success for " &Folder Else Do If ffd.cFileName<>"." And ffd.cFileName<>".." Then Attr=ffd.dwFileAttributes And 255 If Attr And &H10 Then ' s+="" &FindFile(Folder &ffd.cFileName, i, Ext) &"" s+=FindFile(Folder &ffd.cFileName, i, Ext) Else s+=Hex(Attr) &" " &Folder &ffd.cFileName &"\n" End If i+=1 End If Loop While FindNextFile(hFind, @ffd) FindClose hFind End If Return s End Function