Re: Strtran() not working with special characters

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The junk character is really chr(13).
Don't know why it was 'translated' into chr(2) when copied into Notepad and
Visual Studio.
Anyway the functions work. Just had the the wrong character.

Used following code to discover it's real value:
junk=ALLTRIM(applics1)
junk=SUBSTR(junk,LEN(junk),1)
num=0
DO WHILE CHR(num)<>junk AND num<256
num=num+1
ENDDO
? num

Mike


"Mike" <mash@xxxxxxxxxxx> wrote in message
news:DqIcg.6925$8G3.5672@xxxxxxxxxxxxxxxxxxxxxxx
I am using VFP9, SP1.

"Josh Assing" <XjoshX@xxxxxxxxxxx> wrote in message
news:p2k6721fe2go38h9agd63p3v2n4va7k3eq@xxxxxxxxxx

Work sfor me -= what version of vfp are you using?

http://jassing.com/temp/chr2.jpg

Alltrim() only removes "white space(s)", not control characters.

On Tue, 23 May 2006 17:37:17 GMT, "Mike" <mash@xxxxxxxxxxx> wrote:


Some text fields in a table have CTRL characters embedded at the end of
the
field preceded by spaces.
This renders the alltrim() function useless when used prior to output.
When pasted into a text file and viewed in binary they are =chr(2).
I need to remove them.
The at() function, however fails to detect them.
When I use the following code (field=applics1):
x=alltrim(applics1)
x=STRTRAN(x,CHR(2),'')
replace applics1 WITH ALLTRIM(x)

strtran also does not detect chr(2) and the string remains unchanged.

I have a workaround(kluge!) that senses the next last charater after
alltrim() is used.





--- AntiSpam/harvest ---
Remove X's to send email to me.




.



Relevant Pages