Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clipper Unique Filename

Status
Not open for further replies.

fmoore0001

Programmer
Dec 3, 2002
192
0
0
US
Guys, anyone have a routine for creating a truly unique file name in Clipper 5.2e. The one my clients are using on occasion creates a file name that is NOT unique.

Frank
 
I think u want to create temporary work files.

TEMPPRN := "TEMP"+SUBSTR(TIME(),7,2)+SUBSTR(TIME(),4,2)+".PRN"
TEMPDBF := "TEMP"+SUBSTR(TIME(),7,2)+SUBSTR(TIME(),4,2)+".DBF"

This is useful to create unique file names in a network environment.

S.Durai.
 
The above will only create 9999 files.
You could also add the code below in case the file already exists:

TEMPDBF:="TEMP"+SUBS(TIME(),7,2)+SUBS(TIME(),4,2)+".DBF"
do while file(TEMPDBF)
TEMPDBF:="TEMP"+SUBS(TIME(),7,2)+SUBS(TIME(),4,2)+".DBF"
enddo Ian Boys
DTE Systems Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top