# progress bar Logic



## vishalmarya (Nov 8, 2002)

How to implement a typical progress bar ? 

what i want to achieve is the logic behind the filling of a progress bar . 

if my task is to copy a number of files , i know the total no of files , so percentage of total job being done at any point can be calculated and hence progress bar can be updated . 

To increase the accuracy total bytes to be copied can be taken into account . 

But what if i want to do this for saving record(s) in a database table . 

how should i make my prog bar work. 

Any suggestions . ?


----------



## CtrlAltDstry (May 10, 2003)

Well, If you REALLY want a progress bar, you can do this:

Don't save the entire database all at one time. Create a routine that uses a For X=1 To Y* loop to loop through all entries in your database. Then, you can create your progress bar logic based on the current loop number. Your % will be : X/Y

*Or the equivalent in whatever Language you use.


hope that helps! -Ctrl


----------

