Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test extension
Message
From
27/05/2011 04:22:58
 
 
To
27/05/2011 04:09:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01511789
Message ID:
01512000
Views:
40
I'm glad you found the source of your problem.

>sorry to Tom - i see where i went wrong - been a long day. many thanks to all. K
>
>>Please show the COMPLETE code which is not working.
>>
>>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform