Home > Archive > FoxPro database connector > June 2005 > HELP with SCAN and MEMO field UPDATE









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HELP with SCAN and MEMO field UPDATE
John Cosmas

2005-06-20, 8:25 pm

I wrote a simple SCAN statement and it finds the record that I want. I want
to add a specific text into the memo field in that line record. When I add
the text, I need to take the existing content and add to it, or if there is
nothing, just add the text. Please verify this code and share pointers...
As usual, any help would be most appreciated.

PROCEDURE proc_Fix_UWCode

SELECT 0
USE m.gstrAppDir+"wrk_policy" SHARED AGAIN

SCAN
**? wrk_policy.k4
IF k4 = "N0003842" THEN
? wrk_policy.D
? wrk_policy.UW_Note
** UW_Note = " CONTENT_FIXED_BY_MY_
EDITOR" + CHR(10) + UW_Note
MODIFY MEMO wrk_policy.UW_Note
ENDIF
ENDSCAN

RETURN


Fred Taylor

2005-06-20, 8:25 pm

Use REPLACE UW_Note WITH " CONTENT_FIXED_BY_MY_
EDITOR" + CHR(13) + CHR(10) +
UW_Note IN wrk_policy instead of MODIFY MEMO.

Note that you need CHR(13) + CHR(10) to separate new lines.

--
Fred
Microsoft Visual FoxPro MVP


"John Cosmas" <johncosmas@charter.net> wrote in message
news:uZFte.4147$mD6.3440@fe07.lga...
>I wrote a simple SCAN statement and it finds the record that I want. I
>want to add a specific text into the memo field in that line record. When
>I add the text, I need to take the existing content and add to it, or if
>there is nothing, just add the text. Please verify this code and share
>pointers... As usual, any help would be most appreciated.
>
> PROCEDURE proc_Fix_UWCode
>
> SELECT 0
> USE m.gstrAppDir+"wrk_policy" SHARED AGAIN
>
> SCAN
> **? wrk_policy.k4
> IF k4 = "N0003842" THEN
> ? wrk_policy.D
> ? wrk_policy.UW_Note
> ** UW_Note = " CONTENT_FIXED_BY_MY_
EDITOR" + CHR(10) + UW_Note
> MODIFY MEMO wrk_policy.UW_Note
> ENDIF
> ENDSCAN
>
> RETURN
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com