Hi guys
I wonder if any of you can help with this problem.
I wish to import a list of directories from an external drive (F into a list box, allowing a user then to choose the one they require. As these are specific directories they all have an underscore in them.
So far I have been able to get the directories to show as a list in a dialogue.message, but am stuck getting them into a listbox.
My script so far is:-
-- Set the drive to search
drive = "F:\\";
-- Set the folder to search for
folder = "*_*";
-- Search the specified drive for folders inlcuding an "_"
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();
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("Attention", " No Compatible directories found.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
Application.Exit(0);
else
-- If folders were found, display a dialog containing a list of their locations.
message = "Folders have been found as detailed below \r\nPlease select the one you require\r\n";
for index, path in search_results do
message = String.Concat(message, path.."\r\n");
MessDelete = Dialog.Message("Attention", message, MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
What I now need to do is replace the red message with a listbox
Any ideas guys
Thanks
I wonder if any of you can help with this problem.
I wish to import a list of directories from an external drive (F into a list box, allowing a user then to choose the one they require. As these are specific directories they all have an underscore in them.
So far I have been able to get the directories to show as a list in a dialogue.message, but am stuck getting them into a listbox.
My script so far is:-
-- Set the drive to search
drive = "F:\\";
-- Set the folder to search for
folder = "*_*";
-- Search the specified drive for folders inlcuding an "_"
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();
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("Attention", " No Compatible directories found.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
Application.Exit(0);
else
-- If folders were found, display a dialog containing a list of their locations.
message = "Folders have been found as detailed below \r\nPlease select the one you require\r\n";
for index, path in search_results do
message = String.Concat(message, path.."\r\n");
MessDelete = Dialog.Message("Attention", message, MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
What I now need to do is replace the red message with a listbox
Any ideas guys
Thanks
Comment