Have a small dilemma. I'm doing a File.Move (actually allowing the user to save a file to a different location) with this code -
function savefile()
file = Dialog.FileBrowse(false, "Save your file", _DesktopFolder, "All Files (*.*)|*.*|", "*.exe", "exe", false, true);
if (file[1] ~= "CANCEL") then
File.Move(_SourceDrive.."\\originalfile.exe", file[1], false, false, true, true, nil);
else
cancel = Dialog.Message("Cancelled?", "Are you sure you want to cancel?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1);
if (cancel == IDYES) then
return
else
savefile();
end
end
end
The function and all works perfect, except if they saved a file previously as "myfile.exe" and they decide to name the file "myfile.exe" again, it doesn't ask to over-write. Is there a way I can prompt the user "are you sure you want to overwrite this file"? Currently, it just overwrites the file with no prompts.
function savefile()
file = Dialog.FileBrowse(false, "Save your file", _DesktopFolder, "All Files (*.*)|*.*|", "*.exe", "exe", false, true);
if (file[1] ~= "CANCEL") then
File.Move(_SourceDrive.."\\originalfile.exe", file[1], false, false, true, true, nil);
else
cancel = Dialog.Message("Cancelled?", "Are you sure you want to cancel?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1);
if (cancel == IDYES) then
return
else
savefile();
end
end
end
The function and all works perfect, except if they saved a file previously as "myfile.exe" and they decide to name the file "myfile.exe" again, it doesn't ask to over-write. Is there a way I can prompt the user "are you sure you want to overwrite this file"? Currently, it just overwrites the file with no prompts.
Comment