Code :
File.Copy("C:\\1.zip", "D:\\", true, true, false, true, ZipCallBackFunction);
I want :
İf 1.zip copying D:\ ı want the show status dialog 1.zip copying D:\ and ı want show progress bar on status dialog
Ty![]()
Professional Software Development Tools
Code :
File.Copy("C:\\1.zip", "D:\\", true, true, false, true, ZipCallBackFunction);
I want :
İf 1.zip copying D:\ ı want the show status dialog 1.zip copying D:\ and ı want show progress bar on status dialog
Ty![]()
why anybody dont help me![]()
sorry mus, i got tied up with things yesterday
useing the status dialog is as simple as:
Code:StatusDlg.Show(MB_ICONINFORMATION, false); File.Copy(strSource, strDest, true, true, false, true, nil); StatusDlg.Hide();
but heres my revamp of the file copy function that uses the status dialog
hope that helpsCode:-- CopyFile(string SourceFilePath,string DestFolderPath) function CopyFile(strSource,strDest) -- check for source file, if none passed then show file dialog if strSource == "" then tbSource = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false); if tbSource[1] ~= "CANCEL" then strSource = tbSource[1] else -- the user cancled so do nothing Application.ExitScript(); end end -- check for dest folder, if none passed then show folder dialog if strDest == "" then strDest = Dialog.FolderBrowse("Please select a folder:", _DesktopFolder); if strDest == "CANCEL" then -- the user cancled so do nothing Application.ExitScript(); end end -- now make sure we have our source and dest if strSource ~= "" and strDest ~= "" then StatusDlg.ShowCancelButton(true, "Cancel"); StatusDlg.Show(MB_ICONINFORMATION, false); File.Copy(strSource, strDest, true, true, false, true, nil); -- Test for error error = Application.GetLastError(); StatusDlg.Hide(); if (error ~= 0) then if error == 1027 then-- dont inform of a "user cancel" error File.Delete(strDest.."\\"..String.SplitPath(strSource).Filename..String.SplitPath(strSource).Extension, false, false, false, nil); else Dialog.Message("Error: "..error, _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION); end end end end -- Call with empty strings ("") to show dialogs else pass file/folder paths -- Example Call 1, will show file browse dialog and folder browse dialog CopyFile("","") -- Example Call 2, will show a folder browse dialog and copy "Myfile.exe" to the selected folder CopyFile("AutoPlay\\Docs\\Myfile.exe","") -- Example Call 3, will show a folder browse dialog and copy "Myfile.exe" to the the users desktop folder CopyFile("AutoPlay\\Docs\\Myfile.exe",_DesktopFolder)
Open your eyes to Narcissism, Don't let her destroy your life!!
Code :
StatusDlg.Show(MB_ICONINFORMATION, false);
function CopyFile(strSource,strDest)
-- check for source file, if none passed then show file dialog
if strSource == "" then
tbSource = Input.GetText("b");
if tbSource ~= "CANCEL" then
strSource = tbSource
else
-- the user cancled so do nothing
Application.ExitScript();
end
end
-- check for dest folder, if none passed then show folder dialog
if strDest == "" then
strDest = Input.GetText("a");
if strDest == "CANCEL" then
-- the user cancled so do nothing
Application.ExitScript();
end
end
-- now make sure we have our source and dest
if strSource ~= "" and strDest ~= "" then
StatusDlg.ShowCancelButton(true, "Cancel");
StatusDlg.Show(MB_ICONINFORMATION, false);
File.Copy(strSource, strDest, true, true, false, true, nil);
-- Test for error
end
end
-- Call with empty strings ("") to show dialogs else pass file/folder paths
-- Example Call 1, will show file browse dialog and folder browse dialog
CopyFile("","")
-- Example Call 2, will show a folder browse dialog and copy "Myfile.exe" to the selected folder
CopyFile("","")
-- Example Call 3, will show a folder browse dialog and copy "Myfile.exe" to the the users desktop folder
CopyFile("","")
End
Red Text : ı change orjinal code
Im write input ( obj : a ) = _DesktopFolder
Im write input ( obj : b ) = C:\\1.rar
But doesnt copy why ? I dont want FileBrowse
Orjinal Code :
StatusDlg.Show(MB_ICONINFORMATION, false);
function CopyFile(strSource,strDest)
-- check for source file, if none passed then show file dialog
if strSource == "" then
tbSource = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
if tbSource[1] ~= "CANCEL" then
strSource = tbSource[1]
else
-- the user cancled so do nothing
Application.ExitScript();
end
end
-- check for dest folder, if none passed then show folder dialog
if strDest == "" then
strDest = Dialog.FolderBrowse("Please select a folder:", _DesktopFolder);
if strDest == "CANCEL" then
-- the user cancled so do nothing
Application.ExitScript();
end
end
-- now make sure we have our source and dest
if strSource ~= "" and strDest ~= "" then
StatusDlg.ShowCancelButton(true, "Cancel");
StatusDlg.Show(MB_ICONINFORMATION, false);
File.Copy(strSource, strDest, true, true, false, true, nil);
-- Test for error
end
end
-- Call with empty strings ("") to show dialogs else pass file/folder paths
-- Example Call 1, will show file browse dialog and folder browse dialog
CopyFile("","")
-- Example Call 2, will show a folder browse dialog and copy "Myfile.exe" to the selected folder
CopyFile("","")
-- Example Call 3, will show a folder browse dialog and copy "Myfile.exe" to the the users desktop folder
CopyFile("","")
File.Copy(strSource, strDest, true, true, false, true, nil);
End
mus, its all in the explanation
if you pass empty strings it will show dialogs.Code:CopyFile("Path to your file here","path to dest folder here")
Open your eyes to Narcissism, Don't let her destroy your life!!
you cannot write "_DesktopFolder" in a input and expect AMS to use is as a variable, it returns a string, so to AMS it looks like "\"_DesktopFolder\""Im write input ( obj : a ) = _DesktopFolder
you need to enter the full path !!
Open your eyes to Narcissism, Don't let her destroy your life!!
Open your eyes to Narcissism, Don't let her destroy your life!!