Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test extension
Message
 
À
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:
01511988
Vues:
78
>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
>>
thanks tom - i like the format of this - it starts out nicely but breaks down on the last line - with message
C:/MyOriginalFile.txt does not exist
seems like the entry option does not translate to the new title i type in.
maybe i'm doing something wrong in the set up. the file i'm viewing is called m.txt - am i missing a line of code that i should be inserting somewhere. many thanks for your suggestion.
k
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform