Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
StrTran() - any known limitations?
Message
From
31/10/2007 11:42:26
 
 
To
31/10/2007 11:36:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01265319
Message ID:
01265410
Views:
8
>>>>>>Shouldn't be, the string to replace is coming from the big string, i.e. it's derived from it using substr(), so actually ATC() can be replaced with an AT() here.
>>>>>>
>>>>>>And this goes successfully hundreds of times and then starts skipping some replaces.
>>>>>
>>>>>Why do you need loop in the first place?
>>>>
>>>>My first thought was that StrTran() may not find all occurrences of a string in a string that it's changing, specially if the it may change the length of a string and that the next one to change is moved and its original position now contains the replacement of the previous. In my case, I'm replacing any chr(10) with "". So if there were two CRLF pairs there, the 2nd LF would have been where "f" is now. I wasn't sure that Fox would find that each time, and wrote this function specifically to get that bug kicked out.
>>>>
>>>>Except that I haven't seen this happen at all - probably not since 2.0 or so - but have instead run into this "won't really replace when it's not in the first 234.56K of text".
>>>
>>>vfP9 is correct
>>>
>>>? LEN(STRTRAN("AAA","A","")) && return 0
>>>? STRTRAN("ABBB","AB","A")   && RETURN ABB
>>>
>>
>>Hi Fabio,
>>
>>it's nice to see that you show your face, at last. :-)
>
>Hi Tore,
>
>BW image... for now. :)

Knowing you, I guess you uploaded a BW picture since it's smaller, meaning that it will show quicker. :-))
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform