Jeff

Instead of successive calls to STRTRAN, you could achieve the same result with 
just one call to ChrTran

Paul Newton

-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Jeff Johnson
Sent: 19 August 2015 15:10
To: [email protected]
Subject: Re: Problem with COPY and RENAME

This my "clean_url" because these file names come from the web. I left out the 
last line (space) and my files had a space in them.
All is well now.
Excuse the ring.



ln = 0
SCAN
     lcurl = JUSTSTEM(doc_url)
     lcurl = STRTRAN(lcurl, '/', '_')
     lcurl = STRTRAN(lcurl, '\', '_')
     lcurl = STRTRAN(lcurl, ':', '_')
     lcurl = STRTRAN(lcurl, '*', '_')
     lcurl = STRTRAN(lcurl, '?', '_')
     lcurl = STRTRAN(lcurl, '"', '_')
     lcurl = STRTRAN(lcurl, '<', '_')
     lcurl = STRTRAN(lcurl, '>', '_')
     lcurl = STRTRAN(lcurl, ',', '_')
     lcurl = STRTRAN(lcurl, "'", '_')
     lcurl = STRTRAN(lcurl, ' ', '_')

     lcurl = FORCEEXT(lcurl, caf_ext)
     REPLACE doc_url WITH lcurl
ENDSCAN

On 8/19/2015 6:46 AM, Jeff Johnson wrote:
> Doesn't work Ted.
>
> What the heck is going on here? I have been doing RENAMING for years. 
> The paths are valid.
>
> On 8/19/2015 6:29 AM, Ted Roche wrote:
>> On Tue, Aug 18, 2015 at 6:34 PM, Jeff Johnson <[email protected]> wrote:
>>>          RENAME LOWER(lcimportpath + UPPER(lcimage)) TO lcexportpath +
>>> UPPER(ALLTRIM(doc_url))
>>> does not work.
>> Change this to:
>> lcFrom = LOWER(lcimportpath + UPPER(lcimage))
>> lcTo = lcexportpath + UPPER(ALLTRIM(doc_url))
>> RENAME (lcFrom) TO (lcTo)
>>
>> If it works, let me know why ;)
>>
>>   I used the adir() method and it is finding the file, but
>>> there is something wrong with this command.
>>> It looks okay to me.
>>> This is one of those FoxPro things that hangs me up. I could 
>>> probably spend
>>> days figuring this out and it is usually something I am missing.
>>>
>>> On 8/18/2015 1:35 PM, Tracy Pearson wrote:
>>>> Jeff Johnson wrote on 2015-08-18:
>>>>>         lcimage = TRANSFORM(caf_image) + '.' + ALLTRIM(caf_ext)
>>>>>         lcexportpath =
>>>>> 'D:\users\public\applications\ft_cafe\documents\export\' WAIT
>>>>>         WINDOW (lcexportpath) + lcimage + '/' + (lcexportpath) +
>>>>>         UPPER(doc_url) IF FILE((lcexportpath) + lcimage)
>>>>>             COPY FILE (lcexportpath) + lcimage TO (lcexportpath) +
>>>>>    UPPER(ALLTRIM(doc_url))
>>>>>         OR:
>>>>>             RENAME (lcexportpath) + lcimage TO (lcexportpath) +
>>>>>    UPPER(ALLTRIM(doc_url))
>>>>>         ELSE
>>>>>             MESSAGEBOX((lcexportpath) + lcimage + ' file not found.')
>>>>>         ENDIF
>>>>>
>>>>>    Either way it says "file not found" and the file is found 
>>>>> because it
>>>>>    fails on the COPY and the RENAME.
>>>>>      What am I missing?
>>>> Jeff,
>>>>
>>>> In some instances FILE() will return .T. if the file is found in 
>>>> the PATH.
>>>> I have started to use
>>>>       ADIR(...) > 0
>>>> instead of
>>>>       FILE()
>>>>
>>>> Tracy Pearson
>>>> PowerChurch Software
>>>>
>>>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to