Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Begining of the month
Message
De
11/04/2008 16:29:41
 
 
À
11/04/2008 16:09:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01310081
Message ID:
01310086
Vues:
20
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform