Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test extension
Message
From
26/05/2011 04:30:56
 
 
To
26/05/2011 04:26:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01511789
Message ID:
01511795
Views:
65
>>>>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))
>>
>>
>>mmmm not much success with that one Naomi - errors. thanks anyway K
>
>
>Change
>
>>>copy file m.txt to ('c:\Vaniermu\' + justfname(m.fln))
>
>into
>
>>>copy file m.txt to ('c:\Vaniermu\' + m.fln)
>
>ie, take out justfname() which throws away the extension you just added

I'm sorry, but this is incorrect.
Previous
Reply
Map
View

Click here to load this message in the networking platform