Solved

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

Posted on 1997-10-23
4
164 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 50 total points
ID: 1438572
Try using SendMessage with LB_GETTEXT message. Maybe it's just a VB bug.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now