Alaska Software Inc. - Soft returns in memo and memoedit() behavior
Alaska Software Inc. - Soft returns in memo and memoedit() behavior
Username: Password:
AuthorTopic: Soft returns in memo and memoedit() behavior
Tim CallahanSoft returns in memo and memoedit() behavior
on Mon, 16 Jul 2018 10:18:50 -0700
Hello,
I have files with memo fields whose contentes are created with Clipper
MEMOEDIT() function.

These memos have soft returns (chr(141)_chr(10)) embedded in them,
presumabley from the action of Clippers MEMOEDIT() when autowraps
occur in the editing window.

When doing an xBase MEMOEDIT() on these values and then saving them
the 141's are converted into underscores (chr(195)) and the line feeds
(chr(10)) remain.

This is causing frmatting issues when handling these memos in xBase.

Anyone have any experience with anything like this or other
inconsistencies with the memoedit() functions?

Thanks,
Tim
Tim CallahanRe: Soft returns in memo and memoedit() behavior
on Mon, 16 Jul 2018 10:22:47 -0700
Oops, underscore s/b chr(95) not chr(195)

On Mon, 16 Jul 2018 10:18:50 -0700, Tim Callahan wrote:

>Hello,
>I have files with memo fields whose contentes are created with Clipper
>MEMOEDIT() function.
>
>These memos have soft returns (chr(141)_chr(10)) embedded in them,
>presumabley from the action of Clippers MEMOEDIT() when autowraps
>occur in the editing window.
>
>When doing an xBase MEMOEDIT() on these values and then saving them
>the 141's are converted into underscores (chr(195)) and the line feeds
>(chr(10)) remain.
>
>This is causing frmatting issues when handling these memos in xBase.
>
>Anyone have any experience with anything like this or other
>inconsistencies with the memoedit() functions?
>
>Thanks,
>Tim
Pascal BoivinRe: Soft returns in memo and memoedit() behavior
on Thu, 19 Jul 2018 22:17:10 +0200
I simply do this before using the memo
mVar := FIELD->THE_MEMO
mvar := STRTRAN(mvar,CHR(141) + CHR(10),"")

Over time those CHR(141) disappear from the database.
Tim CallahanRe: Soft returns in memo and memoedit() behavior
on Fri, 20 Jul 2018 15:08:26 -0700
Thanks for the input.
I wrote a program to process all fo the memo fields in the database
and do just this.
I had to also replace chr(95)+chr(10) as for some reason the soft
returns are being converted to chr(95) when read from the database.
I'm using ADS so perhaps that part is related to ADS.

On Thu, 19 Jul 2018 22:17:10 +0200, Pascal Boivin wrote:

>
>I simply do this before using the memo
>mVar := FIELD->THE_MEMO
>mvar := STRTRAN(mvar,CHR(141) + CHR(10),"")
>
>Over time those CHR(141) disappear from the database.
Tim CallahanRe: Soft returns in memo and memoedit() behavior
on Fri, 20 Jul 2018 15:51:56 -0700
Just for kicks here's the code:

FOR i := 1 TO 255
   dbselectarea(i)
   IF ! empty(alias())
       Get a list of the memo field numbers
      aMemoFields := {}
      FOR j := 1 TO fcount()
         IF valtype(fieldget(j))='M'
            aadd(aMemoFields,j)
         ENDIF
      NEXT

      IF len(aMemoFields)>0
         dbgotop()
         do while ! eof()
            FOR k := 1 TO len(aMemoFields)
               cMemo := fieldget(aMemoFields[k])
               cMemo := strtran(cMemo, chr(141)+chr(10),'')
               cMemo := strtran(cMemo, chr(95)+chr(10),'')
               if rlock()
	      fieldput(aMemoFields[k],cMemo) 
	      dbunlock()
               endif
            NEXT
            dbskip()
         enddo
      endif
   endif
NEXT