Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

file1.list(i) gives "..."

Posted on 1997-10-23
4
Medium Priority
?
184 Views
Last Modified: 2008-03-06
okay, this should be easy. I have a loop going, processing some files. It goes through the loop and ALWAYS after the fifth time around, it comes back with a filename of "...", even though there are still many files left in the file list box. What's up with that???
0
Comment
Question by:dpms
4 Comments
 
LVL 6

Expert Comment

by:anthonyc
ID: 1438569
dpms,

I am not sure what's going on...  can you show me your code?  fIf you are looping through files, you can do this too....

dim strFile as string

strFile = dir("c:\windows\*.*") 'or whatever path you want
do until strFile = ""
    'process files the way you want
    strFile = dir() 'no path gets next file on the list
loop

0
 

Author Comment

by:dpms
ID: 1438570
Basically, it's like this
for i=1 to file1.filecount
   ---
CatchFileName=file1.list(i)
open CatchFileName as filenumber# for output

After five times around, it comes back as "..." and I can't
see why it does that with viable files still in the file list box.
0
 
LVL 6

Expert Comment

by:alamo
ID: 1438571
First of all,
 for i=1 to file1.filecount
should be
 for i=0 to file1.filecount-1
since the first item in the file list is item 0. but i doubt that's your problem, probably just a typo posting it here.

An obvious possibility is that somehow the value of  i is getting trashed so that you are not processing the item in the listbox you think you are. It's worth checking.

0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1438572
Try using SendMessage with LB_GETTEXT message. Maybe it's just a VB bug.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question