COMPILE

From Recital Documentation Wiki
Revision as of 14:31, 18 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

COMPILE

Class

Applications


Purpose

Compile one or more program files


Syntax

COMPILE <filename>| (<expC>)


See Also

DB_COMPMULICOMM, DO, MODIFY COMMAND, SET COMPILE, SET DEVELOPMENT, SET PSHARE


Description

The COMPILE command translates the source code of the specified program files into object code, and creates a file containing that object code. The object files created by the COMPILE program have the same basename as the program file, but a file extension that ends with an "o". In most cases, the execute-only object code in these files runs much faster than the program files. The gain in speed is dependent on the number and size of the DO WHILE, DO CASE and IF constructs within the program.

Unless the full filename is specified in the <filename> argument, the COMPILE program looks for a file in the current directory and path (see SET PATH) with a .prg extension. COMPILE accepts any file or combination of files that contain source code. You may specify an expression that returns a file name or group of file names, as COMPILE will use all files matching the specified file pattern. The <filename> can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename.

You cannot modify or de-compile an object file; you can only modify the source file. The MODIFY COMMAND, ED and VI commands can be used to modify the source file. If SET DEVELOPMENT is ON, and SET COMPILE is ON, the DO command compares the time and date stamp of a source file with the time and date stamp of its associated object file. If the object file is older than the source file, then DO will recompile the source file before executing it.

In Recital Terminal Developer environments, program files must be compiled before they can be accessed from a server or runtime license. Compiled programs can be run from the operating system prompt as follows:

dbrt <compiled program name>


Example

compile *.prg


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer