Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test extension
Message
De
26/05/2011 07:48:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01511789
Message ID:
01511808
Vues:
68
Hi Karen,

as Naomi already wrote, FORCEEXT() is the function you should use.
lcSrcFName = [MyOriginalFile.txt]
lcNewFName = INPUTBOX( [Filename] , [Define the name of the file] , [MyNewFile] , 0 , [] , [MyNewFile] )
lcNewFName = FORCEEXT( lcNewFName , JUSTEXT( lcSrcFName ) )
COPY FILE ( lcSrcFName ) TO ( lcNewFName )
>
>@ 0,1 say "Re-Name File:  " get fln
>READ
>fln = rtrim(fln)
>COPY FILE m.txt to c:\vaniermu\&fln
>
>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
>
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform