Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo Field Issue
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00858670
Message ID:
00858684
Vues:
17
>How can I clear the content of memo field.
>I have a text in memo field with extra lines in begining and extra lines at end, I want to remove all the sextra spaced and empty lines.
>I tried ALLTRIM() , LTRIM(), RTRIM() but it did not work with the extra lines.
>Any Help.

Try
* New line characters
lcCrLf = CHR(13) + CHR(10)
lcMemo = mytable.memo
* Eliminate empty lines at the beginning
DO WHILE LEFT(lcMemo,2) == lcCrLf
	lcMemo = ALLTRIM(SUBSTR(lcMemo,3))
ENDDO
* Eliminate empty lines at the end
DO WHILE RIGHT(lcMemo,2) == lcCrLf
	lcMemo = ALLTRIM(LEFT(lcMemo, LEN(lcMemo)-2))
ENDDO
REPLACE mytable.memo WITH lcMemo
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform