PDA

View Full Version : add dialog


bobbie
01-15-2007, 04:37 AM
I'm trying to add a dialog message to this when it does not find the file but not having much luck .
I'm not real good yet with the functions so that maybe my problem.
-- Callback function, used when a match is found
function found (filename)

-- Display a dialog to the user
Dialog.Message("FOUND!!", filename .. " was found!!\r\nNow terminating find . . .");
filename = File.Run("notepad.exe", "", "", SW_SHOWNORMAL, false);

-- return false (end the find action)
return false;
end


-- Show the status dialog
StatusDlg.Show();

-- Find any filename containing 'iccvid.dll'. Call function 'found' whenever a match is found
File.Find("c:\\", "iccvid.dll", true, false, nil, found);

-- Hide the status dialog
StatusDlg.Hide();

RizlaUK
01-15-2007, 05:27 AM
just add a "if" statemnt to the file.find action

-- Callback function, used when a match is found
function found (filename)

-- Display a dialog to the user
Dialog.Message("FOUND!!", filename .. " was found!!\r\nNow terminating find . . .");
filename = File.Run("notepad.exe", "", "", SW_SHOWNORMAL, false);

-- return false (end the find action)
return false;
end


-- Show the status dialog
StatusDlg.Show();

-- Find any filename containing 'iccvid.dll'. Call function 'found' whenever a match is found
fFind = File.Find("c:\\", "iccvid.dll", true, false, nil, found);

-- Hide the status dialog
StatusDlg.Hide();

if fFind == nil then
result = Dialog.Message("Notice", "could not find the file.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

bobbie
01-15-2007, 08:58 AM
Wonderful. thank you for the help.

RizlaUK
01-15-2007, 11:37 AM
no problem bobby, always glad to help :yes