Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar

Status
Not open for further replies.

tondi

Technical User
Nov 29, 2001
115
US
Any suggestions for displaying a progress bar when copying files from CD to HD while installing a FPW Application.

Clients are returned to screen too quickly, before copy procedure is completed and removing CD too quickly.

Thanks,

Tony
 
You might find something at:

There are a number of Progress "Thermometers" there.

Of particular interest might be:

COPYFILE.ZIP
"Copy files using low level I/O with progress thermometer.
This program uses Progress Thermometer"


PROGRESS.ZIP
"Progress Thermometer by Cory A. Jaeger displays a
progress thermometer and percent complete"


Note: I have not used these particular routines, so I cannot recommend these based on my personal experience.
But they might work for you.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Thanks for the replies!

Rick .. I am doing copy commands from an 'install.bat' file and also from within an 'update.exe' file.

JBR .. thanks, I will check them out

Tony
 
If you are doing your copy-file routines via a BAT file, you may encounter some difficulty having Foxpro "see" the progress happening and, consequently, difficulty with its ability to run a progress "thermometer".

Check out the download-able routines and see how they work, but you may have to run your copy-files using Foxpro's
COPY FILE <fname1> TO <fname2>

The same may hold true for running within your Update.exe.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Here's a progress bar I use. To run it, put the code in a procedure file, then use this syntax:
Code:
=init_therm()   &&... initialize it here

=ud_therm(10, 1234)  
*... where 10 = % completion, and 1234 is total bytes you 
*... want displayed.  Can be a FOR loop or whatever

=thermdone()   &&... when finished
RETURN

*!*****************************************************************************
*!
*!      Procedure: INIT_THERM
*!
*!*****************************************************************************
PROCEDURE init_therm
   
   IF NOT WEXIST(&quot;therm&quot;)
      DEFINE WINDOW therm ;
         AT  0.000, 0.000  ;
         SIZE 9.889,47.286 ;
         TITLE &quot;* Transferring *&quot; ;
         FONT &quot;FoxFont&quot;, 8 ;
         FLOAT ;
         CLOSE ;
         nominimize ;
         SYSTEM ;
         COLOR RGB(,,,192,192,192)
      MOVE WINDOW therm CENTER
   ENDIF ( NOT WEXIST(&quot;therm&quot;) )
   
   MOVE WINDOW therm CENTER
   
   IF WVISIBLE(&quot;therm&quot;)
      ACTIVATE WINDOW therm SAME
   ELSE
      ACTIVATE WINDOW therm NOSHOW
   ENDIF ( WVISIBLE(&quot;therm&quot;) )
   
   *
   *..... initial box
   *
   @ 1.667,2.000 SAY &quot;Percent Completed...   &quot;  ;
      FONT &quot;Arial&quot;, 10 ;
      STYLE &quot;BT&quot;
   *
   *.... box around bar
   *
   @ 6.000,1.857 TO 8.111,45.000 ;
      PEN 1, 8 ;
      COLOR RGB(128,128,128,,,,)
   
   @ 5.111,0.714 TO 9.000,46.143 ;
      PEN 1, 8 ;
      COLOR RGB(128,128,128,,,,)
   @ 5.111,0.714 TO 8.889,0.714 ;
      PEN 1, 8 ;
      COLOR RGB(255,255,255,255,255,255)
   @ 5.111,0.714 TO 5.111,46.000 ;
      PEN 1, 8 ;
      STYLE &quot;1&quot; ;
      COLOR RGB(255,255,255,255,255,255)
   @ 6.111,44.857 TO 8.111,44.857 ;
      PEN 1, 8 ;
      COLOR RGB(255,255,255,255,255,255)
   @ 8.000,1.857 TO 8.000,44.857 ;
      PEN 1, 8 ;
      STYLE &quot;1&quot; ;
      COLOR RGB(255,255,255,255,255,255)
   IF NOT WVISIBLE(&quot;therm&quot;)
      ACTIVATE WINDOW therm
   ENDIF ( NOT WVISIBLE(&quot;therm&quot;) )
   
   RETURN
   
*!*****************************************************************************
*!
*!      Procedure: UD_THERM
*!
*!*****************************************************************************
PROCEDURE ud_therm
   PARAMETERS prcnt, bytes
   
   prcnt = prcnt/100 
   STORE 42.5 * prcnt TO i
   
   *
   *.... Progress bar
   *
   @ 1.667,2.000 SAY LTRIM(STR(prcnt*100)) + &quot;%&quot; + &quot; Completed,    &quot; + ;
      LTRIM(STR(bytes)) + ' total bytes.';
      FONT &quot;Arial&quot;, 10 ;
      STYLE &quot;B&quot; ;
      COLOR RGB(,,,192,192,192)
   
   @ 6.111,2.000 TO 8.000, 2.2 + i ;
      PATTERN 1 ;
      PEN 1, 8 ;
      COLOR RGB(0,255,255,0,0,255)
   
   @ 6.222, 2.00 + i TO 7.889, 2.00 + i;
      PEN 2, 8 ;
      STYLE &quot;1&quot; ;
      COLOR RGB(0,0,0,0,0,0)
   
   @ 7.778, 2.000 TO 7.778, 2.000 +i;
      PEN 2, 8 ;
      STYLE &quot;1&quot; ;
      COLOR RGB(0,0,0,0,0,0)
   
RETURN
   
*!*****************************************************************************
*!
*!      Procedure: THERMDONE
*!
*!*****************************************************************************
PROCEDURE thermdone
   
   STORE 42.5 TO i
   @ 1.667,2.000 SAY &quot;Percent Completed...  100%                &quot; ;
      FONT &quot;Arial&quot;, 10 ;
      STYLE &quot;B&quot; ;
      COLOR RGB(,,,192,192,192)
   
   @ 6.111,2.000 TO 8.000, 2.2 + i ;
      PATTERN 1 ;
      PEN 1, 8 ;
      COLOR RGB(0,255,255,0,0,255)
   
   @ 6.222, 2.00 + i TO 7.889, 2.00 + i;
      PEN 2, 8 ;
      STYLE &quot;1&quot; ;
      COLOR RGB(0,0,0,0,0,0)
   
   @ 7.778, 2.000 TO 7.778, 2.000 +i;
      PEN 2, 8 ;
      STYLE &quot;1&quot; ;
      COLOR RGB(0,0,0,0,0,0)
   
   PUSH KEY
   ON KEY LABEL ESCAPE *
   STORE 0 TO x
   x=INKEY(2, &quot;H&quot;)
   RELEASE x
   POP KEY
   RELEASE WINDOW therm
RETURN


Dave S.
[cheers]
 
Thanks again for the useful responses & code

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top