Sub Button1_Click
alFiles.Clear
' add the main project file
mainName="Main"
alFiles.Add("project.sbp")
tblFiles.Clear
' start scanning
FileSearch (alFiles, AppPath, "*.bas")
If tblFiles.ColCount<=0 Then
tblFiles.AddCol(cString, "Name", 50, False)
tblFiles.AddCol(cString, "FileName", 50, False)
End If
searchfor="addimagebutton"
For i=0 To alFiles.Count-1
myFileName=alFiles.Item(i)
' grab alle ImageButtons und füge diese der Tabelle hinzu
FileOpen(c1, myFileName, cRead, , cASCII)
cancel=False
' erste Zeile
r = FileRead (c1)
Do Until r = EOF OR cancel=True
' Check the line
If r="@EndOfDesignText@" Then
' Found end of Designer
cancel=True
Else
' check for ImageButton
myfound=StrIndexOf(r, searchfor,0)
' yes found
If myfound>-1 Then
' split it
mySplit()=StrSplit(r, ",")
' grab name und image
' main project file?
If SubString(FileName(myFileName),StrLength(FileName(myFileName))-4,4)=".sbp" Then
myname=mainName&"."&mySplit(1)
Else
' just a bas file
myname=SubString(FileName(myFileName),0,StrLength(FileName(myFileName))-4)&"."&mySplit(1)
End If
myimage=SubString(mySplit(14),1,StrLength(mySplit(14))-2)
' add to table
tblFiles.AddRow(myname,myimage)
End If
End If
r = FileRead (c1)
Loop
FileClose(c1)
Next
' finally save it, provide this list with your application
' you can use it as a reference table
tblFiles.SaveXML(AppPath&"\imagebuttons.xml")
tblFiles.SaveCSV(AppPath&"\imagebuttons.csv",";",True)
End Sub