Question:
I have a memo field in a table, which has been scattered to memvar. I need to append a standard statement to the field once the user has completed entering data.
I am trying to achieve the following effect:
m.dispatchnote=m.dispatchnote+stdstatement
Can you show me a way?
Answer:
What you have done so far is fine, but to update the memo field, you have to perform a GATHER MEMVAR MEMO. This takes the contents of the memory variables and moves them into the fields.Here is a code sample that creates a cursor with a memo field, scatters it into memory variables, updates the memory variable that represents the memo field, gathers the memory variables back into the cursor, and then shows you the contents of the memo field:
stdstatement = "this is my standard statement"CREATE CURSOR Rick (mDNote M)APPEND BLANKREPLACE mDNote WITH "Here is some text."SCATTER MEMVAR MEMOm.mdnote=m.mdnote+stdstatementGATHER MEMVAR MEMOMODIFY MEMO mDNote
If you were not using SCATTER, you could do the following:
REPLACE mDNote WITH mDNote+stdstatement