Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing a filename to the current date\time
Message
 
To
25/02/2004 14:24:25
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00876476
Message ID:
00880958
Views:
11
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform