Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4

Thread: Progress Meter

  1. #1
    Join Date
    Feb 2003
    Location
    Hertfordshire - UK
    Posts
    172

    Progress Meter

    Hi all,

    I am playing with a progress meter and have looked at the demo, but would like a little more power over it's usage. I would like to copy files to the hard drive, and have the meter increment after each action passes back a successful completion. At the moment, it just rattles along (abeit prettily).

    Can anyone post some example code for this? Thanks in advance for your time.
    With our fists clenched,
    We cannot shake hands

  2. #2
    Join Date
    Jul 2000
    Location
    NY
    Posts
    332
    I don't have the code to back this up but heres the basic idea

    First get the the total # of files that you are copying
    Next set the meters range from 0 to the total # of files

    Now create a loop that stops once you reach the total # of files
    In that loop get a file, copy it, and then increment the meter by 1
    This again will repeat until all files are copied

    Hope that helps...I'll see if I can whip up an example when I get a chance

  3. #3
    Join Date
    Feb 2003
    Location
    Hertfordshire - UK
    Posts
    172
    Much appreciated - I kind of had an idea that was the way to proceed.
    With our fists clenched,
    We cannot shake hands

  4. #4
    Join Date
    Jul 2000
    Location
    NY
    Posts
    332
    This is using a status dialog which might not be what you wanted. The code should give you a good sense of how to do what you want ...

    Code:
    --Get all the filenames in the folder Copy at the root of the CD and put them in a table
    FileTable = File.Find("Copy", "*.*", false, false, nil);
    --Count the total # of files
    TotalFiles = Table.Count(FileTable);
    
    --Define count to run repeat loop
    Count = 0
    
    --Display & Define Status Dialog
    StatusDlg.Show(MB_ICONNONE, false);
    StatusDlg.SetTitle("Copying Files");
    StatusDlg.SetStatusText("Copying Files:");
    StatusDlg.SetMeterRange(1, TotalFiles);
    StatusDlg.SetMeterPos(Count);
    
    repeat
    
    --Increment count to get next filename from the table
    Count = Count+1
    
    --Copy the file from the original location to the Paste folder at the root
    File.Copy(_SourceFolder.."\\"..FileTable[Count], _SourceFolder.."\\Paste", true, true, false, true);
    
    --Display current filename
    StatusDlg.SetStatusText("Copying Files: "..FileTable[Count]);
    --Change meter position
    StatusDlg.SetMeterPos(Count);
    
    --end loop once all files copied
    until Count == TotalFiles 
    
    --Hide the status dialog
    StatusDlg.Hide();
    Last edited by kpsmith; 04-23-2004 at 11:13 AM.

Similar Threads

  1. Progress Meter
    By MWMTex in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 03-12-2008, 11:43 PM
  2. Progress Meter Plugin Help
    By MWMTex in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 03-18-2004, 08:25 PM
  3. Spotlight: Progress Meter Object Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 03-10-2004, 03:39 PM
  4. Progress Meter
    By Jimbo2112 in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 02-23-2004, 02:22 PM
  5. Progress meter VS. StatusDlg
    By arnaud in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 02-05-2004, 02:16 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