John Fletcher
08-20-2007, 08:01 AM
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:
http://www.globalpresentations.net/filesearch.jpg
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
-- 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:
http://www.globalpresentations.net/filesearch.jpg
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