find all txt files in a directory and write their names to an array

Alex Chatwin
06-09-2003, 10:21 AM
could do with some help . I have a program which is based on data from a number of text files. I want the user to be able to add new data by adding a new text file. The i/o stuff is ok, but I need a way for the program to detec which txt files are in the program directory and then allow the user to add them, without the need for a file/open box. how do I get VB6 to find all txt files in a directory and write their names to, say, an array

Thanks for your time

OnErr0r
06-09-2003, 10:49 AM
Call Dir$ in a loop, see the example at:

http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctDir.asp

Alex Chatwin
06-10-2003, 11:30 AM
Thanks very much, i've got it now

alexc

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum