These commands let you move code between the stored procedures of a database and text files. APPEND PROCEDURES adds the contents of a file to the current database's stored procedures, while COPY PROCEDURES lets you save the stored procedures in a file.
APPEND PROCEDURES FROM FileName
[ AS nCodePage ]
[ OVERWRITE ]
COPY PROCEDURES TO FileName
[ AS nCodePage ]
[ ADDITIVE ]As with other APPEND/COPY pairs, the default for APPEND is additive, while the default for COPY is destructive. Hence, APPEND PROCEDURES has an optional OVERWRITE keyword that lets you replace what's already there, while COPY PROCEDURES has an optional ADDITIVE clause that lets you keep what's already there and add to it.
The AS codepage in each command specifies a codepage for the text file. On the way in, FoxPro converts from that codepage to the database's codepage. On the way out, the reverse happens.
COPY PROCEDURES assumes an extension of TXT (rather than PRG, as we'd expect). APPEND PROCEDURES, on the other hand, is even less sensible—if you don't give it an extension, it assumes you don't want one. So APPEND PROCEDURES FROM MyProc doesn't look for MyProc.PRG or even MyProc.TXT, but just plain old MyProc. The upshot of all this is that you should always include the extension with these commands.
In VFP 7, if the database has Database Events turned on, the BeforeAppendProc and AfterAppendProc events fire for APPEND PROCEDURES, and the BeforeCopyProc and AfterCopyProc events fire for COPY PROCEDURES.
OPEN DATA MyTestData
APPEND PROCEDURES FROM GetId.PRG
COPY PROCEDURES TO TestProc.PRGAfterAppendProc, AfterCopyProc, BeforeAppendProc, BeforeCopyProc, Display Procedures, Modify Procedure

