Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing extra blanks in a memo field
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00355212
Message ID:
00355453
Views:
26
This is another version of this program: (BTW, Mike, I found a bug in your mhHTMLcode program, you'll see by yourself)

********************************************************************
* Description.......: CleanMemo - trims all spaces
* Calling Samples...: CleanMemo(myMemo) && where MyMemo is a field name
* Parameter List....: lcMemo
* Created by........: Nadya Nosonovsky 04/04/00 09:46:59 PM
* Modified by.......: 
********************************************************************
lparameter lcMemo
if empty(lcMemo)
lcMemo=replicate(' H e l l o '+;
chr(10)+chr(13)+;
' My test '+chr(13)+chr(13)+;
' This is a s t r i n g',100) 
endif 
local lcFinalMemo, lnDesiredMemoWidth, i, lcOldSetMemo, lnLines, lcTemp, lcTempOld
lcFinalMemo=''
lnDesiredMemoWidth=50 && set to your preference
lcOldSetMemo=set('memowidth')
set memowidth to lnDesiredMemoWidth
lnLines=memlines(lcMemo)
STORE 0 TO _MLINE && Reset _MLINE to zero
FOR count = 1 TO lnLines && Loop for # of lines in memo field
lcTemp=alltrim(MLINE(lcMemo, 1, _MLINE)) && each line
for i=len(lcTemp)-3 to 2 step -2
lcTemp=strtran(lcTemp,space(i),space(1))
next 
lcFinalMemo=lcFinalMemo+space(1)+lcTemp
NEXT
? lcFinalMemo
? len(lcFinalMemo)
=strtofile(lcFinalMemo,'testmemo.txt')
modi comm testmemo.txt
return lcFinalMemo

>>BTW: Can someone explain to me how to use the PRE coding tags explained in item 5 of basic notes of the rules of conduct?
>
>Charles, the PRE tags need to be put inside angled brackets < pre > and < /pre > (but without the spaces between bracket and text I used).
>
>Unindented text
>     Indented text
>          Still further
>Check the Source with View Source to see where the tags are.
>
>Oddly enough, when used in any other web page the text inside the PRE and /PRE tags not only shows all spaces and indents but is in a fixed-width font. On UT the text shows leading spaces but (at least on my browser) shows in the same proportional font as the remainder of the text. Maybe I need to check my profile to see if I have something setup incorrectly.
>
>HTH
>Barbara
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform