Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Directory Order backwards.
Message
From
02/07/2009 13:17:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Directory Order backwards.
Miscellaneous
Thread ID:
01409797
Message ID:
01409797
Views:
121
Can someone please tell me why the directories that are deleted are the "latest" - and what i need to change in the code
to get the "earliest" directories erased. I though "D" meant order by date so the loop should move from earliest to latest. no?

tnx K

fso = CREATEOBJECT("Scripting.FileSystemObject")
lnNum =adir(ladir,'c:\vault\FP*','D')
asort(ladir)
if lnnum>80
FOR nCount = 1 TO lnnum-30 && Loop for number of databases
? LADIR(nCount,1)+" Erased"
fso.DeleteFolder("c:\vault\&ladir(nCount,1)")
ENDFOR
endif
Next
Reply
Map
View

Click here to load this message in the networking platform