******************************************************************** * 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
>Unindented text > Indented text > Still further>Check the Source with View Source to see where the tags are.