Help:Howto run a progress bar using the size of a file as progressbar.max 
Author Message
 Help:Howto run a progress bar using the size of a file as progressbar.max

The problem is this, when i open a file i want to run a progress bar while
loding,
this file is about 20 MB
i used the linecount or len(...) methode. And then run the progress bar
these methodes thakes alot of time to count this size of files first and
then run the progressbar.
Another problem whit this methode is that the progress bar begins to run
after counting al the lines or characters.
my question is.
is it possible to look to the size of the file and then run the progress bar
while loding the file into a variable.

thanks in advance
Ron



Fri, 11 Apr 2003 03:00:00 GMT  
 Help:Howto run a progress bar using the size of a file as progressbar.max

1. Get file size, you can use GetFileSizeEx WinAPI function (See API Viewer
for declaration).
2. Read file part by part, 1024 bytes maybe, into array.
You can compute the percentage of progess using this way.

You cannot open the file as text because you don't know how many lines in
it.
But if you wish to open as text file you can read char by char into variable
until found Line break ASCII 13 and 10.

Remember, for better performance, don't change progressbar value every a
char reading.
It's better to increse PB value only 100 time for a whole file.



Sat, 12 Apr 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Max file size using Open

2. File Loading Progress Form with Progress Bar

3. Help: Progress Bar code generates Run Time Error 6

4. Using progress bar for copying file

5. Using progress bar for copying file

6. Copying files in VB5 and using the progress bar

7. Using progress bar for copying file

8. Help needed with Progress Bars and Status Bars

9. HElp with progress bar on MDI status bar

10. Help please : copying files and the progress bar.

11. Help please : copying files and the progress bar.

12. HElp with progress bar on MDI status bar

 

 
Powered by phpBB® Forum Software