Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trimming blanks on a memo field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00625134
Message ID:
00625205
Vues:
12
Trimming carriage returns and line feeds? Here is what I do:
FOR i = 1 TO LEN(this.result)
    IF ASC(SUBSTR(this.result, i, 1))=10 .and. i>1
   	this.result = LEFT(this.result, i-1)
    ENDIF
    IF ASC(SUBSTR(this.result, i, 1))=13 .and. i>1
	this.result = LEFT(this.result, i-1)
    ENDIF
ENDFOR
>Hello Vlad and Eric,
>
>Vlad suggested:
>>Does following command works for you?
>>alltrim(strtran(MyMemoField,chr(13),''))
>>You can use also
>>alltrim(strtran(MyMemoField,chr(13)+chr(10),''))
>>in case 2 characters used (CR and LF) as a new line.

>
>I think that either of these will remove intentional new lines embedded in the memo field. My take on Eric's request is that excess trailing CR / LF / spaces need to be trimmed off. I've seen code that does this, but sorry to say don't have it handy right now.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform