Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    64

    Help badly needed with simple code!

    Hi and sorry for being so stuppid here, but why wont the following code work :

    StatusDlg.Show(MB_ICONNONE, false);
    StatusDlg.ShowCancelButton(true, "Cancel");
    File.Copy(_SourceDrive.. "\\DCIM\\100CAMEA\\*.*", "D:\\Backup\\DigiCam\\", true, true, true, true, nil);
    error = Application.GetLastError();
    StatusDlg.Hide();
    if error ~= 0 then
    result = Dialog.Message("Error", "There was an error copying the files to your system. Please try again.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
    else
    --it was sucessful!!
    end

    I get the following error:

    There was an error copying files to your system"

    Sorry again & help greatfully recieved

  2. #2
    Join Date
    May 2006
    Posts
    1,443
    File.Copy(_SourceDrive.. "\\DCIM\\100CAMEA\\ *.*" , "D:\\Backup\\DigiCam\\", true, true, true, true, nil);

    this must be real file path

    for multiple file copy operations use following code

    Code:
    search = File.Find(_SourceDrive.. "\\DCIM\\100CAMEA\\" , "*.*", false, false, nil, nil);
    if search ~= nil then
    StatusDlg.Show(MB_ICONNONE, false);
    StatusDlg.ShowCancelButton(true, "Cancel");
    for i,file_path in search do 
    File.Copy(file_path, "D:\\Backup\\DigiCam\\", true, true, true, true, nil);
    error = Application.GetLastError();
    if error ~= 0 then
    Dialog.Message("Error", "There was an error copying the:\n"..file_path, MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
    end
    end
    StatusDlg.Hide();
    --it was sucessful!!
    else
    Dialog.Message("Error", "No Files Found In Destination Folder", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
    end

  3. #3
    Join Date
    Nov 2006
    Posts
    64
    Thanks for that, but I spotted my mistake...
    I built it as a single, compressed file and of course, this runs from the hard drive, not the media I wanted it to run from (digital camera memory card)

    it all works perfect now thanks dude

Similar Threads

  1. Article: Using Authenticode Code Signing Certificates
    By Ted Sullivan in forum Setup Factory 8.0 Examples
    Replies: 4
    Last Post: 10-31-2007, 09:03 AM
  2. Error with simple code transfer from v4.0 to v6.0
    By morci in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 01-03-2006, 03:27 PM
  3. Few simple questions...
    By daveinmb in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 03-22-2004, 01:49 AM

Posting Permissions

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