Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to question
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to question
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01131752
Message ID:
01131752
Vues:
65
I have a routine that runs once a day to check for a new file to import, after I import that file, I create a backup copy and store it in the same directory. I want to only keep the last four of of those files, so whenever my routine runs, after I create the backup copy, I want to delete all but the last four. The filenames for the backup start with the character I and then the datetime() the backup was created. How do I sort the results of adir() command by the first element (filename). Once I have the array in the right order, I can just loop through, starting on the 5th one and delete the files. Below is what I was trying, but it doesn't sort it in decending order. I think I'm missing something in the asort.


Thanks
lnFiles=ADIR(laBackFiles,'i*.dat')
ASORT(laBackFiles,1,1,1)
? laBackFiles[1,1] && I20060623113811.DAT
? laBackFiles[2,1] && I20060623115915.DAT
? laBackFiles[3,1] && I20060623123535.DAT
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform