Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 8.0 Command Question

Status
Not open for further replies.

MSW

IS-IT--Management
Jan 9, 2002
48
0
0
US
Hello I've written a simple program that looks into a folder to determine if any files exist that match my lookup and return a .T. or .F. depending on the results. My problem is I'm using IF FILE('filename*.dat') command and it will not allow me to use the wildcard.. Am I doing something wrong here or is that just the way it is. Are there other commands that I can use to do what I need if this command won't work..

Thanks for your help
 
MSW,
The help file seems clear that FILE() checkes for a single file. If you want to use a wild card check, use ADIR(). For example:
Code:
?ADIR(laFiles,HOME(1)+"fox*")
Rick
 
Hi

I think the ADIR command does what you require and it supports wildcards, it returns the number of matches found and stores further details into an array of you choice.

eg ;

Code:
lnHowManyFiles = ADIR(laMyFileArray,"*.txt")

Hope this helps, Mark



 
That works...

Thanks again for your help...Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top