ST3VO
asked on
Problem with Loop
Hi all,
I am using WebCopy from TMS to download a list of images which is populated in a listbox.
So, I've done a loop but it's not downloading all of them. The loop is skiping items.
What's wrong with my code please?
Here it is:
var i: integer;
begin
for i:=0 to listbox1.Count-1 do
begin
WebCopy1.Items.Add.Protoco l := wpHTTP;
WebCopy1.Items.Add.FileDat e := EncodeDate(2002,3,18);
WebCopy1.Items.Add.CopyNew erOnly := false;
WebCopy1.Items.Add.TargetD ir := 'c:\1temp';
WebCopy1.Items.Add.URL := (listbox1.Items.Strings[i] );
end;
WebCopy1.Execute;
end;
Hope you can help!
Thanks
ST3VO
I am using WebCopy from TMS to download a list of images which is populated in a listbox.
So, I've done a loop but it's not downloading all of them. The loop is skiping items.
What's wrong with my code please?
Here it is:
var i: integer;
begin
for i:=0 to listbox1.Count-1 do
begin
WebCopy1.Items.Add.Protoco
WebCopy1.Items.Add.FileDat
WebCopy1.Items.Add.CopyNew
WebCopy1.Items.Add.TargetD
WebCopy1.Items.Add.URL := (listbox1.Items.Strings[i]
end;
WebCopy1.Execute;
end;
Hope you can help!
Thanks
ST3VO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK....I'll see what I can come up with!
ASKER
Thanks....I sorted it out!
can you check if the problem happens only with selected files and always with them? (remove some items from listbox (items that are copied) If this is happening, then you need to somehow get the info back from tms web copy which sould include the http response for each item.
also, I suppose you have sufficient space on your harddrive.
I also suppose that the items from the listbox are correct urls (do not contain invalid characters, etc).
but first, we need to know if the problem is with some specific files or it's random, in which case we need to look at tms webcopy.
if you can make that webcopy to throw/log some errors, it would be almost perfect. I myself never worked with that so I don't know the internals, but I am sure that we can help you out provided you give us some more details as merijnb suggested.