Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test extension
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01511789
Message ID:
01511790
Vues:
96
This message has been marked as a message which has helped to the initial question of the thread.
>Is there a way to test the extension of data entered.
>Here i ask if the operator wants to name the file but if the extension txt is not typed
>i would like the program to add it automatically. Any siggestons would be appreciated
>thanks K
>
>
>@ 0,1 say "Re-Name File:  " get fln
>READ
>fln = rtrim(fln)
>COPY FILE m.txt to c:\vaniermu\&fln
>
Why you're writing DOS-style code?

Take a look at JUSTEXT() and FORCEEXT() functions in help.
fln = putfile('Rename File:',,'txt')

if empty(justext(fln))
   fln = forceext(fln, 'txt')
endif

copy file m.txt to ('c:\Vaniermu\' + justfname(m.fln))
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform