Hi guys,
I have this line code:
fwrite(marq,'<xLgr>'+Alltrim(oArqCli:ENDERECO)+'</xLgr>'+mfim)
Just fine but in some cases a blank caracter apears in xml (end of oArqCli:ENDERECO field) like this:
<xLgr>RUA 2 QD 13 LT 15 </xLgr>
Shouldn't Alltrim() remove whites at the beginning and end?
Thanks!
Alltrim() help
Re: Alltrim() help
Yes, AllTrim is used for remove blank spaces at end and at begining
Please, put this code
Please, put this code
Code: Select all | Expand
? Asc( Right( Alltrim(oArqCli:ENDERECO), 1 ) ) == 32
? Asc( Right( Alltrim(oArqCli:ENDERECO), 1 ) )
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Re: Alltrim() help
cnavarro wrote:Yes, AllTrim is used for remove blank spaces at end and at begining
Please, put this codeCode: Select all | Expand
? Asc( Right( Alltrim(oArqCli:ENDERECO), 1 ) ) == 32
? Asc( Right( Alltrim(oArqCli:ENDERECO), 1 ) )
Hi cnavarro,
The result:
.F.
160
In asc table 160 = á
How this is possible? I don't see á but a space. How I can avoid this?
Thanks in advance.
Re: Alltrim() help
Use
https://stackoverflow.com/questions/279 ... th-numbers
Code: Select all | Expand
cStr := StrTran( cStr, Chr( 160 ), " " )
https://stackoverflow.com/questions/279 ... th-numbers
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Alltrim() help
http://fivewin.com.br/index.php?/topic/28336-pequisa-aven%C3%A7ada/
Code: Select all | Expand
// Endereco/Calle/Direccion
cDocXml = TIRA_ACENTUACAO( oArqCli:ENDERECO )
? cDocXml
FUNCTION TIRA_ACENTUACAO( cStr )
LOCAL cStrNew := "", nX
cAcentos := { "‡", "A", "—", "ƒ", "Æ", "Ç", " ", "µ", "…", "·", "‚", "É", "ê", "ˆ", "", "Ò", "í", "Í", "ó", "¢", "à", "ä", "å", "“", "â", "ú", "é", "", "š", "ç", "€", "ã", "Ã", "á", "Á", "à", "À", "é", "É", "ê", "Ê", "í", "Í", "ó", "Ó", "õ", "Õ", "ô", "Ô", "ú", "Ú", "ü", "Ü", "ç", "ù", "AAO", "§", "¦", "º", "ª", "€", "‡", "Ç", "ç", "'", "`", "ø", "¡", "Þ", "×", "Ø", "ÿ", "Ö", CHR(160), CHR(239) }
cLetras := { "C", "A", "U", "A", "A", "A", "A", "A", "A", "A", "E", "E", "E", "E", "E", "E", "I", "I", "O", "O", "O", "O", "O", "O", "O", "U", "U", "U", "U", "C", "C", "A", "A", "A", "A", "A", "A", "E", "E", "E", "E", "I", "I", "O", "O", "O", "O", "O", "O", "U", "U", "U", "U", "C", " ", "AAO", ".", ".", ".", ".", "C", "C", "C", "C", "" , "" , ".", "I", "I", "I", "I", "", "I", "", "" }
FOR nX := 1 TO LEN( cAcentos )
cStrNew := StrTran( cStr, cAcentos[nX], cLetras[nX] )
cStr := cStrNew
NEXT
RETURN( cStrNew )
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Alltrim() help
karinha wrote:http://fivewin.com.br/index.php?/topic/28336-pequisa-aven%C3%A7ada/Code: Select all | Expand
// Endereco/Calle/Direccion
cDocXml = TIRA_ACENTUACAO( oArqCli:ENDERECO )
? cDocXml
FUNCTION TIRA_ACENTUACAO( cStr )
LOCAL cStrNew := "", nX
cAcentos := { "‡", "A", "—", "ƒ", "Æ", "Ç", " ", "µ", "…", "·", "‚", "É", "ê", "ˆ", "", "Ò", "í", "Í", "ó", "¢", "à", "ä", "å", "“", "â", "ú", "é", "", "š", "ç", "€", "ã", "Ã", "á", "Á", "à", "À", "é", "É", "ê", "Ê", "í", "Í", "ó", "Ó", "õ", "Õ", "ô", "Ô", "ú", "Ú", "ü", "Ü", "ç", "ù", "AAO", "§", "¦", "º", "ª", "€", "‡", "Ç", "ç", "'", "`", "ø", "¡", "Þ", "×", "Ø", "ÿ", "Ö", CHR(160), CHR(239) }
cLetras := { "C", "A", "U", "A", "A", "A", "A", "A", "A", "A", "E", "E", "E", "E", "E", "E", "I", "I", "O", "O", "O", "O", "O", "O", "O", "U", "U", "U", "U", "C", "C", "A", "A", "A", "A", "A", "A", "E", "E", "E", "E", "I", "I", "O", "O", "O", "O", "O", "O", "U", "U", "U", "U", "C", " ", "AAO", ".", ".", ".", ".", "C", "C", "C", "C", "" , "" , ".", "I", "I", "I", "I", "", "I", "", "" }
FOR nX := 1 TO LEN( cAcentos )
cStrNew := StrTran( cStr, cAcentos[nX], cLetras[nX] )
cStr := cStrNew
NEXT
RETURN( cStrNew )
Thanks but in this especific case the content "SAO MATHEUS " your function change the value to SAOAMATHEUSAAAAAAAAAAAAAAAAAAAA, not work.
Re: Alltrim() help
cnavarro wrote:UseCode: Select all | Expand
cStr := StrTran( cStr, Chr( 160 ), " " )
https://stackoverflow.com/questions/279 ... th-numbers
Thank you! I will try.