Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Check: Putting Files Into A Loop
Message
From
06/05/2005 15:11:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/05/2005 15:01:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01011748
Message ID:
01011758
Views:
13
>I am seeking a way to put all the files in a directory in a loop and checking check file name for a certain string within the file and if that string exist I want to delete that file.
>
>How can I do this?
>
>
>Thank You In Advance
>
>
>Winfred Majors

adir() will get a list of files into an array. You can then loop through the array - see also alen(), or just use the return value:
for i = 1 to adir(laFiles, "*.txt")
  ? laFiles(i, 1)
next
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform