Solved

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

Posted on 1997-10-23
4
166 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

825 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