Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begining of the month
Message
From
11/04/2008 16:29:41
 
 
To
11/04/2008 16:09:10
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01310081
Message ID:
01310086
Views:
19
>what is the function for the begining of the month?
>eg: for this month, I want to have 04-01-2008 (01 April)
>
>How to make sure the text is a valid file name?
>eg: user can decide what file name for the backup, such as: Mar08
>I want to make sure the name entered is a valid file name, not the name Mar'08
>
>thanks for the help
>
>Jerry

To get the First Day of the Month you can use
DATE() - DAY(DATE()) + 1
For the file name you might try something like
FUNCTION isLegalFileName
LPARAMETERS tcFile
lnHandle = FCREATE(tcFile + ".@@@XXX")  
&& FCREATE will overwrite existing file so force an extension which won't exist
IF lnHandle > 0    && Legal File
    =FCLOSE(lnHandle)
    DELETE FILE (tcFile + ".@@@XXX")
    RETURN .T.
ELSE
    RETURN .F.
ENDIF
BTW.........Mar'08 is a legal file name.
Previous
Reply
Map
View

Click here to load this message in the networking platform