Discussion:
HELP with SCAN and MEMO field UPDATE
(too old to reply)
John Cosmas
2005-06-20 20:49:29 UTC
Permalink
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-21 01:29:57 UTC
Permalink
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
Post by John Cosmas
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
Loading...