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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bar progress for vfp3

Status
Not open for further replies.

urbain

Programmer
Joined
Apr 26, 2003
Messages
10
Location
DO
hello,

Looking to implement a bar progress to show progress on copying tables.If a command exist,I have no clue whatsoever.
Can someone help?
 
How are you copying tables? There are a number of ways to do this! e.g.
COPY TO ...
COPY FILE
RUN COPY ...
Win API - CopyFile() or CopyFileEx()
WSH - CopyFolder() or CopyHere()

Rick
 
hi rick
tks for your reply.
datas from table would be filtered and append to new file and new directory,so while doing so i would like to have a way to see the progress for each file.
tks agn
 
[tt]
************************************************************
*-- Program: P_ThermGeneric
*-- Author: Darrell C. Greenhouse
*-- Last Upate:
*-- Created: 2003.06.11
*-- Description: Example of a generic Thermometer
*-- Pass:
*-- Returns:
*-- Called by:
*-- Calls:
*-- Assumuptions:
*-- Notes:
*-- Todo:
*-- Revisions:
************************************************************

LOCAL lnFiles, oForm

lnFiles = 879 && Simulates the files to copy
* Note: lnFiles could be records, files, bits, etc...

oForm = CREATEOBJECT("Therm",lnFiles)
oForm.SHOW()

FOR i = 1 TO lnFiles
oForm.UpdateTherm(i)

* Just to simulate processing time of file copy function
lnSec = SECONDS()
DO WHILE SECONDS()-lnSec < .010
ENDDO
NEXT

DEFINE CLASS Therm AS FORM
DOCREATE = .T.
AUTOCENTER = .T.
HEIGHT = 60
WIDTH = 500
TITLEBAR = 0
BACKCOLOR = RGB(255,0,0)
nBumpPerc = 0 && This is the percentage of each tick

ADD OBJECT shpTherm AS SHAPE WITH;
LEFT = 5, ;
WIDTH = 0 , ;
TOP = 10, ;
HEIGHT = 40, ;
FILLSTYLE = 0, ;
FILLCOLOR = RGB(0,0,255)

ADD OBJECT lblPerc AS LABEL WITH;
HEIGHT = 20, ;
CAPTION = &quot;&quot;, ;
FONTSIZE = 12, ;
FORECOLOR = RGB(255,255,255), ;
BACKSTYLE = 0, ;
TOP = THIS.HEIGHT / 2 - 10, ;
VISIBLE = .F.

PROCEDURE INIT
LPARAM lnCount
THIS.nBumpPerc = lnCount/100
ENDPROC

PROCEDURE UpdateTherm(lnBump)
LOCAL lnThermMaxWidth

WITH THIS

lnThermMaxWidth = THIS.WIDTH - 10
.shpTherm.WIDTH = INT((lnBump/.nBumpPerc/100)*lnThermMaxWidth)
.lblPerc.VISIBLE = .T.
.lblPerc.CAPTION = &quot;% Complete &quot;+ALLT(STR(INT(lnBump/.nBumpPerc)))
.lblPerc.AUTOSIZE = .T.
.lblPerc.LEFT = .WIDTH / 2 - .lblPerc.WIDTH / 2

IF INT(lnBump/.nBumpPerc) == 100
* Give a visual delay to show 100% complete. Satisfies the user.
LOCAL lnDelay
lnDelay = SECONDS()
DO WHILE SECONDS()-lnDelay < .75
ENDDO
ENDIF

ENDWITH
ENDPROC
ENDDEFINE
[/tt]

'We all must do the hard bits so when we get bit we know where to bite' :-)
 
In that case, you'd normally use a UDF() call in the APPEND for clause that updates a progress bar (perhaps like the one above) and always returns .T. The difficult part is knowing how many records you are going to process if you are filtering them.

Rick
 
Hi darrellblackhawk ,
how can i use your code while copying file,indexing,sql,calculation,scan..endscan options etc..

TIA

Soykan OEZCELIK
 
tks Darell,

Very usefull,I'm modifying it to have two progress bar.
first one to simulate my dbf file list and second to simulate each file on the list.Did not finish it yet, but i'll manage.
tks again
urbain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top