COMPILE PROGRAM Command

See Also

Compiles one or more source files and creates an object file for each source file.

Syntax

COMPILE PROGRAM FileName | FileSkeleton | ? [ENCRYPT] [NODEBUG] [AS nCodePage]

Arguments

PROGRAM

Specifies that the file to compile is a program file (.prg). This option ignores the SET COMPILE setting.

FileName | FileSkeleton

Specifies for compilation a single file FileName or a set of files that match a file skeleton FileSkeleton containing wildcards such as * and ?. For example, to compile all program files with the extension .prg in the current directory or folder, issue COMPILE *.PRG.

?

Displays the Compile dialog box, allowing you to choose a file to compile.

ENCRYPT

Encrypts your compiled Visual FoxPro programs. Cannot be used with the CLASSLIB, LABEL, and REPORT keywords. This prevents any access to your original source programs. For additional source code protection, always include this option when compiling programs intended for distribution.

NODEBUG

Reduces the size of your compiled file by 2 bytes per source file line. Cannot be used with the CLASSLIB, LABEL, and REPORT keywords. These two bytes in the compiled file are a reference to the corresponding line in the source file. Removing these two bytes doesn't affect the program's performance, but it does reduce your compiled file size, and conserves disk space.

When you include NODEBUG, you cannot view a program's execution in the Trace window or use MESSAGE(1) to return the source code for a line that causes an error.

AS nCodePage

Specifies the code page for which the program is compiled. Cannot be used with the CLASSLIB, LABEL, and REPORT keywords. The compilation code page you specify with this clause overrides the global compilation code page specified with SET CPCOMPILE.