Home page  
Help >
COPY for Memo Fields
Version 7.11
COPY for Memo Fields

There are five ways of copying memo fields. In the syntax below, "c" is a collection-name, "tname" means table-name, and "mfname" means memo-field-name.

Form1:Memo-to-File
COPY MEMO [FROM] c tname mfname [TO] *filename

Form2:File-to-Memo
COPY MEMO [FROM] *filename [TO] c tname mfname

Form3:Memo-to-Memo in same record
COPY MEMO [FROM] c tname mfname1 [TO] c tname mfname2

Form4:Memo-to-Memo in another record
COPY MEMO [FROM] c1 tname1 mfname1 [TO] c2 tname2 mfname2

Form5:Multiple X fields to Memo field
COPY MEMO [FROM] c1 tname1 fieldname [TO] c2 tname2 mfname2

Options:
A -Append to, rather than replace existing file
E -If an error occurs, do not abort the procedure
O -(Forms 1 and 2) Copy to ASCII rather than SGML
R -(Form 1 only) Suppress overstore notification
S -(Form 5 only) Use soft instead of hard carriage returns
X -Suppress the command response
Y -Do not alter the command answer cells

Answers:
Ctl.Ans1 =1 if successful, 0 if not
Ctl.Ans2 =Zero
Ctl.Ans3 =Zero

Notes:
FROM and TO are optional and are allowed for readability. The source of the copy is always name1 and the target is always name2.

In form1 if the file name did not previously exist it is created by the COPY command. The file is created as an SGML (Standard Graphical Markup Language) file so as to preserve any graphics in the memo field. Use of the O option causes the file to be an ASCII text file, but only text will be copied, no graphical components.

Note the asterisks immediatly in front of (no blank) the file names in forms 1 and 2. They are required. The file names can be full path names. If the path is omitted, the current directory is assumed.

In forms 1 through 4 of COPY MEMO only single records are involved. If you have multiple files to copy into the memo fields of different records, you do them one at a time (a procedure involving a FETCH/n loop could be used to automate this process).

In form 4 a single record is isolated in c1 and a single record is isolated in c2 prior to the COPY MEMO.

Form 5 involves a collection of non-memo fields being copied into a single memo field. In this case the entire collection is operated on, so multiple non-memo fields are copied. They are separated with hard carriage returns. An S option (COPY/s MEMO) causes soft carriage returns instead.

Use of the E option means if an error occurs, do not print an error message and do not terminate the current procedure. The application must check the %status variable to determine success or failure.

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.