Difference between revisions of "COMPILE"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
''[[COMPILE Commands|COMPILE ... commands]]''
 +
 
==Purpose==
 
==Purpose==
 
Compile one or more program files
 
Compile one or more program files
 
  
 
==Syntax==
 
==Syntax==
COMPILE <filename>| (<expC>)
+
COMPILE <filename>| (<expC>) [NOTALK]
 
+
  
 
==See Also==
 
==See Also==
[[CERROR()]], [[DB_COMPMULICOMM]], [[DO]], [[ED]], [[MODIFY COMMAND]], [[SET COMPILE]], [[SET DEVELOPMENT]], [[SET PROCEDURE]], [[SET PSHARE]], [[VI]]
+
[[CERROR()]], [[DO]], [[SET PROCEDURE]]
 
+
  
 
==Description==
 
==Description==
Line 16: Line 15:
 
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.
 
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.
+
You cannot modify or de-compile an object file; you can only modify the source file. 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:
+
 
+
<pre>
+
dbrt <compiled program name>
+
</pre>
+
  
 +
If the NOTALK keyword is included, compilation messages are not displayed.
  
 
==Example==
 
==Example==
Line 30: Line 24:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Applications]]
+
[[Category:Libraries]]
[[Category:Applications Commands]]
+
[[Category:User Defined Functions]]

Latest revision as of 12:13, 5 February 2018

COMPILE ... commands

Purpose

Compile one or more program files

Syntax

COMPILE <filename>| (<expC>) [NOTALK]

See Also

CERROR(), DO, SET PROCEDURE

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 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.

If the NOTALK keyword is included, compilation messages are not displayed.

Example

compile *.prg