lcPath = ADDBS(GETENV("TEMP"))
lcTable = 'Test'
lcTable_ = lcTable
lnLoop1 = 1
DO WHILE USED(lcTable_) OR FILE(lcPath+lcTable_+'.dbf')
lcTable_ = lcTable+'_'+TRANSFORM(lnLoop1)
lnLoop1 = lnLoop1+1
ENDDO &&USED(lcTable_)
lcTable = lcTable_
lcTable_ = lcPath+lcTable_
CREATE TABLE lcTable_ (...)
INSERT INTO (lcTable) (...
If you avoid the OR FILE(lcPath+lcTable_+'.dbf') clause you can generate speaking cursor names as well.
This is useful in debugging iterations or rekursions.
I have an UDF with Filename as parameter and return is the free name.
>
>You could also use "DescriptiveTableName_" + sys(2015).
The solution above give me iteration deepness
AgnesWords are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
Off
There is no place like [::1]