Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove carriage returns in memos
Message
 
To
12/06/2001 08:08:01
Denis Filer
University of Oxford
United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00518280
Message ID:
00518282
Views:
22
>Is there an obvious way to remove trailing carriage returns at the end of memo field - nasty in reports that display alltrimed memos. I have tried a substr() command replacing chr(13) with "" but this not working. Thank you in advance if someone knows the best way.

How about this.

Put memo field into a variable

lcMemoField = ALLTRIM(Table.MemoField)

Get the length

lnLengthOfMemoField = LEN(lcMemoField)

check to see if last character is carriage return

IF SUBSTR(lcMemoField,lnLengthOfMemoField,1) = CHR(13)
Remove it
REPLACE Table.MemoField WITH SUBSTR(lcMemoField,1,lnLengthOfMemoField-1)
ENDIF


I am sure you can combine the above lines into one, but I separated them for readability of what I was doing.

HTH
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform