Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    88

    Search File Code - Help Please!

    Below is the complete code that I could find for the File Search AMS development produced by AZman - I attained this AMS development from http://www.azman.info This is a cool code yet I believe there are missing peramiters.

    -- Page - on show --

    -- Clears all items from combobox
    ComboBox.ResetContent("ComboBox1");

    -- Get a list of the available drives.
    tDrives = Drive.Enumerate();

    if tDrives then
    for i,driveInfo in tDrives do
    ComboBox.AddItem("ComboBox1", driveInfo, driveInfo);
    end
    end

    ComboBox.SetSelected("ComboBox1", 1);


    -- LB_FileListStep1 - on double click --


    LB = "LB_FileListStep1";
    -- Get the selected items
    tSelected = ListBox.GetSelected(LB);

    -- ListBox object, we are only concerned with tSelected[1]

    if tSelected then
    -- There is an item selected, get the data!
    sFileToOpen = ListBox.GetItemData(LB, tSelected[1]);
    File.Open(sFileToOpen, "McKesson", SW_SHOWNORMAL);
    else
    -- Display an error message
    Dialog.Message("Error", "There is no item selected.");
    end


    -- LB_FileListStep1 - on select --

    LB = "LB_FileListStep1";
    -- Get the selected items
    tSelected = ListBox.GetSelected(LB);

    -- Because we are not allowing multiple select in the
    -- ListBox object, we are only concerned with tSelected[1]

    if tSelected then

    -- There is an item selected, get the data!
    sFile = ListBox.GetItemData(LB, tSelected[1]);
    nSize = File.GetSize (sFile);
    tFileAtt = File.GetAttributes (sFile);
    sFileCreated = tFileAtt.CreationDate;
    sFileLastAccess = tFileAtt.AccessDate;
    sFileLastWritten = tFileAtt.WriteDate;

    Paragraph.SetEnabled("Para_FileProps", false);

    else
    -- Display an error message
    Dialog.Message("Error", "There is no item selected.");
    end


    -- Button1 - on click --

    LB = "LB_FileListStep1";

    ListBox.DeleteItem("LB_FileListStep1", -1);

    sFileSearch = Input.GetText("Input_FileSearch");
    if sFileSearch=="" then
    Dialog.Message("Notice", "PLEASE ENTER FILE NAME", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
    nSelected = ComboBox.GetSelected("ComboBox1");
    if nSelected ~=-1 then
    sDrivePath = ComboBox.GetItemData("ComboBox1", nSelected);
    tFiles = File.Find(sDrivePath, sFileSearch, false, true, nil, nil);

    if tFiles then
    for i,FilesPath in tFiles do
    ListBox.AddItem(LB, FilesPath, FilesPath);
    end
    else
    Dialog.Message("SEARCH RESULT", "FILES NOT FOUND");
    end

    else
    Dialog.Message("Notice", "PLEASE SELECT A DRIVE", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end
    end


    When a user launches the program - there is a file name input field, a select a drive dialog field, a Button and a section for the data to show- Image below:



    When a user types in the file name field the code does not search for anything close - it must be an exact match in addition - I would like to specify a drive rather then having someone see all the drives on the computer - also would like to be able to see the sub folders in the folders that are visible


    I know this is alot here - any one have any Idea's

    Best Regardas,

    John

  2. #2
    Join Date
    Aug 2007
    Posts
    88

    Huh? Is this in the wrong section?

    Did I place this request in the wrong section?

    Please advise-----

    Best Regards,

    John Fletcher
    Last edited by John Fletcher; 08-20-2007 at 02:03 PM. Reason: Typo

  3. #3
    Join Date
    Nov 2006
    Posts
    233
    so the first thing is that you want to do a wildcard search i.e look for files containing the specified text? rather than an exact match.

    second was to specify a drive rather than give a choice

    and 3rd was to see the subfolders etc.

    I put together a little example that is attached below that covers all 3 hope it helps you figure out what you need..
    Attached Files

  4. #4
    Join Date
    Feb 2008
    Posts
    146
    Desrat, you give me to permisson to change anything in your apz?

Similar Threads

  1. Probably a dumb question
    By beeneeb in forum Visual Patch 2.0
    Replies: 1
    Last Post: 10-12-2006, 01:19 PM
  2. Search: How to find any file containing search keyword
    By RobbyH in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 01-12-2003, 12:37 AM
  3. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  4. search for file...(sintaxis) I'm in hurry help
    By Yuri in forum AutoPlay Menu Studio 3.0
    Replies: 2
    Last Post: 05-01-2002, 05:02 AM
  5. Replies: 2
    Last Post: 01-18-2002, 09:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts