> procedure TForm2.FtpProgress(Sender: TObject; Count: Int64;
>   var Abort: Boolean);
> begin
>    ProgressBar.Position := Count;
> end;

Correct concept, but you also need to set the ProgressBar Min and Max
properties to indicate how much progress has been made.  

The FTP event simply returns a count of the number of bytes transferred, which
might be zero to several billion, so Min should be set to zero and Max to the
size of the file being uploaded, before the upload starts.  Harder for
downloads where you need to know the size of the file first.

Also, this event will typically be called dozens of times per second on a fast
internet connection, and updating the screen is time consuming so can slow down
the transfer speed, and the change may be invisible. 

So you generally put more intelligence in the progress function to update no
more than once every one or more seconds or when there is a substantial change,
like 1 to 5%.

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to