Board index » delphi » Please help...Loading file and showing the progress in eg progressbar

Please help...Loading file and showing the progress in eg progressbar

Please someone help me to solve this problem.

I want to load a big file and I also want to show how far it comes in
loading.  I've tried lots of thing , but nothing works!

Could anyone helpme????

//Richard   <rfr...@nordm.se>

 

Re:Please help...Loading file and showing the progress in eg progressbar


rfr...@nordm.se (Richard Frank <rfr...@nordm.se>) wrote:

Quote
>Please someone help me to solve this problem.
>I want to load a big file and I also want to show how far it comes in
>loading.  I've tried lots of thing , but nothing works!
>Could anyone helpme????

I don't know _how_ you load this file...

If you load it character by character, here's an example:

FS := TMemoryStream.Create;
FS.LoadFromFile(FileName);
ProgressBar.Max := FS.Size;

try
  repeat
    // read one char or whatever you want
    ProgressBar.Position := FS.Position;  // that's it!
  until
    FS.Position>=FS.Size;
finally
  FS.Free;

If you don't do so, please post your code (or the interesting part of
it) !

Other Threads