filesearch keyword

Discussion in 'Questions (Windows Mobile)' started by Cableguy, May 16, 2007.

  1. Cableguy

    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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The first parameter (files in your example) should be an ArrayList.
     
  3. Cableguy

    Cableguy Expert Licensed User

    You mean that I need to add the array list before i call the filesearch keyword, right?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    That is correct.
     
  5. Cableguy

    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!
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Try this:
    Code:
    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
     
  7. Cableguy

    Cableguy Expert Licensed User

    Thanks Erel,

    Now I see were I was going wrong...
     
Loading...