Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing extra blanks in a memo field
Message
From
04/04/2000 16:37:13
Charles Richard
Nvo Management Systems
Boisbriand, Quebec, Canada
 
 
To
04/04/2000 15:45:04
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00355212
Message ID:
00355264
Views:
28
Try the following code:

PRE

PROCEDURE cleanmemo
LPARAMETERS memotext
LOCAL newtext
m.newtext = CHRTRAN(m.memotext, CHR(13), ' ')
m.newtext = CHRTRAN(m.newtext, CHR(10), ' ')
m.newtext = ALLTRIM(STRTRAN(m.newtext, ' ', ' '))

IF .NOT. (m.newtext == m.memotext)
m.newtext = cleanmemo(m.newtext)
ENDIF
RETURN m.newtext

/PRE

test suggestion:
Create testing text in test.txt and run:

? '<' + cleanmemo(filetostr('test.txt')) + '>'

HTH
Charles Richard
NVO Management Systems
crichard@nvo.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform