help in search file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • gallurt
    Forum Member
    • Oct 2006
    • 8

    help in search file

    I need help.

    Code:
    myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);
    
    docsfolder = _SourceFolder.."\\Autoplay\\Docs", false, true, nil, nil
    subfolders = Dialog.Message("Recurse Subfolders", "Do you want to include subfolders", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2)
    if (subfolders == IDYES) then
    subfolder = true
    else
    subfolder = false
    end
    file_table = File.Find(docsfolder, "*.*", subfolder, false, nil);
    if (file_table == nil) then
    Dialog.Message("Error", "There were no audio files in the selected Directory. Please select a directory that contains audio files", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1)
    dirselect = "NO";
    else
    file_count = Table.Count(file_table);
    ctr = 1;
    dirselect = "YES";
    StatusDlg.SetMeterRange("1", file_count);
    StatusDlg.SetTitle("Please wait while your audio files are loaded.");
    StatusDlg.Show(MB_ICONNONE, false);
    for i,file in file_table do
    videonametable = String.SplitPath(file);
    videoname = videonametable.Filename;
    result = ListBox.AddItem("ListBox2", videoname, file);
    StatusDlg.SetMeterPos(i);
    end
    StatusDlg.Hide();
    end
    
    if numitems == 0 then
    ListBox.SelectItem("ListBox2", 1);
    end

    I cannot make work .

    It always looks for although it does not put text in imput.

    sorry by my badly English .


    thanks
    Attached Files
  • jfxwave
    Forum Member
    • Mar 2006
    • 145

    #2
    You need to explan better on what you want to do.

    What do you want to show in the Input box?
    or
    Do you want to search for a song by typing it in the Input box?

    Comment

    • gallurt
      Forum Member
      • Oct 2006
      • 8

      #3
      Do you want to search for a song by typing it in the Input box?

      yes, exact..

      Comment

      • jfxwave
        Forum Member
        • Mar 2006
        • 145

        #4
        I don't really know what your trying to do but you can try this, change whats in red.
        myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);

        docsfolder = _SourceFolder.."\\Autoplay\\Docs", false, true, nil, nil
        subfolders = Dialog.Message("Recurse Subfolders", "Do you want to include subfolders", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2)
        if (subfolders == IDYES) then
        subfolder = true
        else
        subfolder = false
        end
        sResult = Input.GetText("Search");

        file_table = File.Find(docsfolder, sResult..".*", subfolder, false, nil);
        if (file_table == nil) then
        Dialog.Message("Error", "There were no audio files in the selected Directory. Please select a directory that contains audio files", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1)
        dirselect = "NO";
        else
        file_count = Table.Count(file_table);
        ctr = 1;
        dirselect = "YES";
        StatusDlg.SetMeterRange("1", file_count);
        StatusDlg.SetTitle("Please wait while your audio files are loaded.");
        StatusDlg.Show(MB_ICONNONE, false);
        for i,file in file_table do
        videonametable = String.SplitPath(file);
        videoname = videonametable.Filename;
        result = ListBox.AddItem("ListBox2", videoname, file);
        StatusDlg.SetMeterPos(i);
        end
        StatusDlg.Hide();
        end

        if numitems == 0 then
        ListBox.SelectItem("ListBox2", 1);
        end

        Comment

        • gallurt
          Forum Member
          • Oct 2006
          • 8

          #5
          thanks is perfect..

          Comment

          Working...
          X