|
-
Nov 21st, 2010, 10:08 PM
#1
Thread Starter
Addicted Member
List1.listcount problem
My program has come along nicely the past couple of days. After inserting and removing my errors along the way I've now come to the last stage of this part of the program.
So far the user types in a website address into the combo. It brings up a list of files available for download from that webpage. It saves the list to disk, including the date the file(from website) was created, the size of the file, the users filename, webpage filename, and an indicator as to whether the file has been been downloaded yet or not.
The user can then click on the listbox name and hit return, to indicate he has downloaded/not interested in downloading the file and it will move the file over to list2. It will also change the indicator on the file to show the file has been downloaded. In the same way if the user decides otherwise that he wants to download the file again he can go into list2 and click on the file name, hit the enter key and it will move the file back into list1 and change the txt file over to indicate the file hasn't been downloaded.
Once the user has the list down to the files he wishes to download he can click on the files and click the Rename button and rename the files with a filename he finds useful. This is the users filename I mention up in paragraph 2. It doesn't change the webpage filename just the name the file will be saved under.
The next step is to download the files. This wouldn't be a problem other than I have to get the the web address first. I'm planning to have it so the user could go out and have everything setup and hit either one of two buttons, Download This Site or Download All Sites. In either case their could many files, some quite big...I've see one file over 1GB in size already. I gave the user the option of being able to change the filenames ahead of time so he could get everything prepped and ready to download and then he could download while sleeping at night, at work the next day, etc. If he selects Download All Sites it will go through all the sites he has looked at and will download all the files from each of those sites that he wants to download.
Once a file has been downloaded I'm planning on having the filename moved over to List2 and have the txt file indicator changed to show the file has already been downloaded.
In some cases their could be several to many files from one site. At the same time their could be none from another site. The worst problem right now(the only thing I have tried thus far), I believe is when their is only one file from a given site that is to be downloaded.
eTitle is the user filename and eYN(something already created for another section of the program and I'm just reusing it for right now) is the website filename. The program will pull the website domain from Combo1.
Code:
For i = List1.ListCount - 1 To 0 Step -1
strTitle = List1.List(i)
For j = Len(strTitle) To 0 Step -1
If Mid(strTitle, j, 1) = "/" Then 'looking for leading "/" to indicate beginning of filename
strTitle = Right(strTitle, Len(strTitle) - j)
' List2.AddItem strTitle
' List1.RemoveItem i
For Counter6 = 0 To i
If eTitle(Counter6) = strTemp Then
eId(Counter6) = "1"
strTemp = "http://" & Combo1.Text & "/" & eYN(Counter6)
' Call SaveFileList
End If
Next Counter6
Exit For
End If
Next j
Next i
It appears since List1 only has one file in it that the first file must be number 0. When I go to For Counter6 = 0 to i it doesn't want to execute the For...Next loop. As a result it won't create the address that is suppose to be downloaded.
I have noticed in some other testing that I'm now having the same trouble in the Rename code. The code is pretty much copy and pasted from the Rename section to the Download section. I didn't have the problem earlier...then again I hadn't removed the files earlier to only have one file left to download in any one list.
How do I eliminate this problem. I know ever since Saturday morning I've been fighting off and on at times with List1.Listcount trying to get that darn thing to work correctly.
Thanks
PS I just checked thanks to stumbling into something online. I downloaded the list from another website and decided to try to change the user filename. It changed slick as a whistle. I went back to one of the sites/lists where I only had one file. I tried to rename the file and it wouldn't bring up the Inputbox. I think the problem is now very evident.
Last edited by hijack; Nov 21st, 2010 at 10:28 PM.
Reason: I just made a quick check
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|