You can be sure that the file name created from sys(2015) is unique.
I didn't have case the function returned the same name.
To answer your question, I don't think so. Because foxpro is single threaded and excutes commands in a sequence, so in your code here
strToFile would not be excuted untile if .not. file(thisname) is done.
You can check the return value of strtofile() see if the file is created or not.
It may be insignificant, but the code your have typed has two syntax errors.
do while needs a corresponding enddo and after "if not file(thisname)" has a ";" which would make strtofile() useless. Anyway, you would compile time error messages.
Suppose that I want to create 200 unique files names and files, would I overwhelm the drive,
if I simply did something like because there's nothing here to give the drive time to do
search for each file name.
myCount = 1
myString = "asdf"
do while myCount < 201
ThisName = SUBSTR(SYS(2015),2,8) + ".txt"
if .not. file(ThisName) ;
strToFile(myString, ThisName)
myCount = myCount + 1
endif
endif
Dawa Tsering
"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."
- Ephesians 4:29-30 NIV
Dare to Question -- Care to Answer
Time is like water in a sponge, as long as you are willing you can always squeeze some.
--Lu Xun, Father of Modern Chinese Literature