Append Procedures, Copy Procedures
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.
Usage |
APPEND PROCEDURES FROM FileName [ AS nCodePage ] [ OVERWRITE ] COPY PROCEDURES TO FileName [ AS nCodePage ] [ ADDITIVE ] |
In VFP 3, when the stored procedures already contain RI code generated by the RI builder, there's no final return. When you APPEND PROCEDURES, the first line of the text file ends up on the same line as the final RI-generated line. Leaving things that way is guaranteed to cause trouble down the road, so you'll want to make sure the extra return gets in there somehow, whether by manually inserting it or by making sure the first line of the appended file contains just a return. In VFP 5 and later, RI code does have a final return, so this is a non-issue. |
APPEND PROCEDURES only works when the full VFP environment is available, since it needs to be able to compile the procedures. Trying to use it in a runtime environment results in a "feature is not available" error. The reason for this is that VFP needs to be able to compile the procedures. While that was a reasonable limitation in versions prior to VFP 6 Service Pack 3, VFP has been able to compile files in a runtime environment since that release. We suspect this is one of those things the Fox team just forgot to change. |
Example |
OPEN DATA MyTestData APPEND PROCEDURES FROM GetId.PRG COPY PROCEDURES TO TestProc.PRG |
See Also |
AfterAppendProc, AfterCopyProc, BeforeAppendProc, BeforeCopyProc, Display Procedures, Modify Procedure |