Stop my loop lockups!

Hercules
09-09-2003, 08:45 PM
Hi all..

I'm using the API to get a list of files in a directory and them spit them into a list box and have a progress bar update. I have this working fine.

However, once these values are in a collection (the filenames that is), I do a for loop that goes from 1 to ubound(collection).

It's in this loop that I lock up on big searches. For example, if a user selects the directory to be 'listed' then there are a *lot* of files. The progress bar moves but the list does not add values until the end of the loop, where they all show up.

Is there any way to avoid a loop that cuts off access to VB? I don't like losing control for a few minutes as the files are looped thru.

passel
09-09-2003, 08:47 PM
Add the statement DoEvents someplace in your loop so that VB can do events.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum