again.
i m trying to figure out how to add exra drives and locations in drive i mean if folder not found on c drive how i can add to go to d drive or some other locations i was trying elseif but couldnt get it working.
can one can suggest or give hint or anyting?
fname = Input.GetText("Input1");
-- Set the drive to search
drive = "c:\\";
-- Set the folder to search for
folder = fname;
-- Search the specified drive for folders named enterd
-- Display the status dialog
StatusDlg.Show(0, false);
search_results = Folder.Find(drive, folder, false, FindCallBack);
--Check to see if an error occurred during the search. If it did, display the error message.
error = Application.GetLastError();
StatusDlg.Hide();
if error ~= 0 then
Dialog.Message("Error",_tblErrorMessages[error]);
else
-- If no directories were found, inform the user
if (search_results == nil) then
Dialog.Message("Notice", "There is no folder named '" .. folder .. "' on system '" .. drive .. "'.");
-- If folders were found, display a dialog containing a list of their locations.
else
message = "A User named '" .. folder .. "' was found at the following location(s):\r\n\r\n";
for index, path in search_results do
message = String.Concat(message, path.."\r\n");
end
Dialog.Message("File Search Results", message, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
end
i m trying to figure out how to add exra drives and locations in drive i mean if folder not found on c drive how i can add to go to d drive or some other locations i was trying elseif but couldnt get it working.
can one can suggest or give hint or anyting?
fname = Input.GetText("Input1");
-- Set the drive to search
drive = "c:\\";
-- Set the folder to search for
folder = fname;
-- Search the specified drive for folders named enterd
-- Display the status dialog
StatusDlg.Show(0, false);
search_results = Folder.Find(drive, folder, false, FindCallBack);
--Check to see if an error occurred during the search. If it did, display the error message.
error = Application.GetLastError();
StatusDlg.Hide();
if error ~= 0 then
Dialog.Message("Error",_tblErrorMessages[error]);
else
-- If no directories were found, inform the user
if (search_results == nil) then
Dialog.Message("Notice", "There is no folder named '" .. folder .. "' on system '" .. drive .. "'.");
-- If folders were found, display a dialog containing a list of their locations.
else
message = "A User named '" .. folder .. "' was found at the following location(s):\r\n\r\n";
for index, path in search_results do
message = String.Concat(message, path.."\r\n");
end
Dialog.Message("File Search Results", message, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
end
Comment