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

ProgressBar (out ot range error)

Status
Not open for further replies.

topcat01

Programmer
Jul 10, 2003
83
0
0
GB
I am using the default prgress bar that comes with delphi 6, which works fine when processing files less than 2gb in size. When i try to process files greater than 2gb i get the error 'TProgressBar property out of range'. I think the problem is this line 'frmMain.ProgressBar1.Max := FileSize(F);' ???

TIA
 
I believe filesize doesnt work on files over 2GB, but I cant check that for you right now as I am at home, when I get back at work I'll look into it for you.

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
Great Delphi Websites faq102-5352
 
Maybe a cleaner way of doing the progress bar as well would be to make the max of the progress bar to be 100 and get the progress like this

progressbar1.count := <position in file> / filesize(f) * 100

That would give you the percentage out of 100 of the position in the file that you are at. You would also have to round the number to the nearest whole number (as you can't use a floating point number with the progress bar) :)
 
Max is an integer.

Integer -2147483648..2147483647


KungTure-RX.jpg

//Nordlund
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top