Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2007
    Posts
    287

    Cool Help status dialog

    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

  2. #2
    Join Date
    Jul 2007
    Posts
    287
    why anybody dont help me

  3. #3
    Join Date
    Jul 2007
    Posts
    287

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    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
    Code:
    -- 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)
    hope that helps
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    Jul 2007
    Posts
    287

    Wink

    Quote Originally Posted by RizlaUK View Post
    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
    Code:
    -- 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)
    hope that helps
    ty too you are very crazy man

  6. #6
    Join Date
    Jul 2007
    Posts
    287
    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

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    mus, its all in the explanation

    Code:
    CopyFile("Path to your file here","path to dest folder here")
    if you pass empty strings it will show dialogs.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    May 2006
    Posts
    5,380
    Im write input ( obj : a ) = _DesktopFolder
    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\""

    you need to enter the full path !!
    Open your eyes to Narcissism, Don't let her destroy your life!!

  9. #9
    Join Date
    Jul 2007
    Posts
    287
    Quote Originally Posted by RizlaUK View Post
    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\""

    you need to enter the full path !!
    Ok finished now work my options.. ty too for help me

  10. #10
    Join Date
    May 2006
    Posts
    5,380
    Quote Originally Posted by mustafa06 View Post
    Ok finished now work my options.. ty too for help me

    anytime mus, glad you got it sorted
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. Using the Status Dialog Window
    By Adam in forum AutoPlay Media Studio 7.5 FAQ
    Replies: 0
    Last Post: 12-14-2007, 12:08 PM
  2. Status Dialog text disappears
    By Lizard in forum Setup Factory 7.0
    Replies: 4
    Last Post: 09-20-2006, 11:15 AM
  3. Using the Status Dialog Window
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-22-2003, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts