filesearch keyword

Cableguy

Expert
Licensed User
Hi

As I understood from the help file, the filesearch keyword provides two variable, one being an array that contains the filenames, and the number of files found...
How do I code this?

I tryed:

n=filesearch(files,apppath&"\imageset","*.dll")

this gives me a null reference error..
For the moment the dir is empty, so if should return 0, shouldn't it?
 

Erel

Administrator
Staff member
Licensed User
The first parameter (files in your example) should be an ArrayList.
 

Cableguy

Expert
Licensed User
I still can't gett it to work...

I want to pass to labels the filenames found in the directory.
Can you exemplify how to pass the array...please!
 

Erel

Administrator
Staff member
Licensed User
Try this:
B4X:
Sub Globals

End Sub

Sub App_Start
    Form1.Show
    AddArrayList("al1")
    FileSearch(al1,AppPath,"*.jpg")
    For i = 0 to al1.Count - 1
        ListBox1.Add(FileName(al1.Item(i))) 'Omit the FileName if you need the complete path.
    Next
End Sub
 
Top