Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing a filename to the current date\time
Message
 
À
25/02/2004 14:24:25
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00876476
Message ID:
00880958
Vues:
12
>How can I be assured that it will be unique? I use the sys(3) function to produce probably hundreds of files, and if one is accidentally overwritten it would be bad. Thanks!
>
>MAC

If you want to stick to 8 letters file names, You could use adir in conbination with sys(3) to get unique names, something like: (Assuming default path)
local lcFileName, laFiles(1)
lcFileName = sys(3)
do while adir(laFiles, forcext(lcFileName, 'DBF'))=1
   lcFileName = sys(3)
enddo
You can use also file(lcFileName) although it has some problems, or sys(2000) to verify if the file exists
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform