Difference between revisions of "COMPILE"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=COMPILE=
 
 
 
==Class==
 
Applications
 
 
 
 
==Purpose==
 
==Purpose==
 
Compile one or more program files
 
Compile one or more program files
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[DB_COMPMULICOMM]], [[DO]], [[MODIFY COMMAND]], [[SET COMPILE]], [[SET DEVELOPMENT]], [[SET PSHARE]]
+
[[CERROR()]], [[DB_COMPMULICOMM]], [[DO]], [[ED]], [[MODIFY COMMAND]], [[SET COMPILE]], [[SET DEVELOPMENT]], [[SET PROCEDURE]], [[SET PSHARE]], [[VI]]
  
  
Line 27: Line 20:
 
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:
 
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:
  
 +
<pre>
 
dbrt <compiled program name>
 
dbrt <compiled program name>
 +
</pre>
  
  
Line 37: Line 32:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Applications]]
 +
[[Category:Applications Commands]]

Latest revision as of 15:09, 10 November 2009

Purpose

Compile one or more program files


Syntax

COMPILE <filename>| (<expC>)


See Also

CERROR(), DB_COMPMULICOMM, DO, ED, MODIFY COMMAND, SET COMPILE, SET DEVELOPMENT, SET PROCEDURE, SET PSHARE, VI


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 Server, Recital