Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo Field Issue
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00858670
Message ID:
00858684
Views:
16
>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--
Previous
Reply
Map
View

Click here to load this message in the networking platform