Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jamie Osborn
  Where is Jamie Osborn?
 Melbourne
 Australia
 Jamie Osborn
 To: Fred Cohen
  Where is Fred Cohen?
 Moorestown
 New Jersey - United States
 Fred Cohen
 Tags
Subject: RE: Possible to include datetime in file name?
Thread ID: 34024 Message ID: 34025 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Saturday, December 06, 2003 10:05:24 PM         
   


> I have a very valuable table that I wish to save before adding or subtracting data, which I do frequently. I've tried concatenating
> a name that includes TTOC(datetime()) and backing up using an ampersand before the concatenated variable , but it doesn't work . . . no error message, but a file with the new name doesn't show up in the target directory.
>
> Can anyone straigten me out on this?
>
> Fred888

A filename in Windows can't contain a ":" - that is why it is failing.

Try :
lcFileName = CHRTRAN(TTOC(DATETIME()),":","-")

If you ever need to get the file back you can use CHRTRAN() to put the ":" back in.

Cheers,
Jamie
jamie.osborn@foxite.com

ENTIRE THREAD

Possible to include datetime in file name? Posted by Fred Cohen @ 12/6/2003 8:51:54 PM
RE: Possible to include datetime in file name? Posted by Jamie Osborn @ 12/6/2003 10:05:24 PM
RE: Possible to include datetime in file name? Posted by Chan Kok Kiet @ 12/7/2003 6:41:06 AM