Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid filename
Message
De
08/03/2011 21:43:00
Neil Mc Donald
Cencom Systems P/L
The Sun, Australie
 
 
À
08/03/2011 21:19:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
01502980
Message ID:
01502981
Vues:
77
>I have a backup menu dan the client can create his own backup filename.
>
This is what we use, is was from Chris Lange I think
********************************************************************
FUNCTION lValidFileName( tcFileName )
********************************************************************
  LOCAL lcValidChars, lcUpperJustFileName

  m.lcValidChars        = " ^'@{}[],=()+._-!$%&/#~1234567890ABCEDFGHIJKLMONPQRSTUVWXYZ"
  m.lcUpperJustFileName = UPPER( JUSTFNAME(m.tcFileName) )

    DO CASE
	CASE EMPTY( m.lcUpperJustFileName )
		RETURN .F.
	CASE INLIST( JUSTSTEM(m.lcUpperJustFileName), "AUX", "COM1", "COM2", "COM3", "COM4", "CON", "LPT1", "PRN" ) 
		RETURN .F.
	CASE LEN( CHRTRAN( m.lcUpperJustFileName, m.lcValidChars, "" ) ) > 0
		RETURN .F.
	OTHERWISE
		RETURN .T.
    ENDCASE

ENDFUNC 
Regards N Mc Donald
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform