[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Clipper Compiler
Syntax: CLIPPER <source file>/@<script file> [<options>]
Arguments: <source file> is the name of the program file to
compile to an object file. The file must have a (.prg)
extension, but the extension need not be specified. In
addition, the <source file> reference may optionally
include a drive designator and/or a path reference.
<script file> is the name of a text file containing a
list of source files to compile into a single object
file. The list may include program, procedure, and
format files. Files (including procedure files) referred
to within the specified program file are not compiled.
The resultant object file has the same name as the script
file.
A script file is created according to the following
rules:
. The script file must have an (.clp) extension.
. Source files are separated by a carriage return/line
feed
. All source files must have a (.prg) extension
. Rename format (.fmt) files to have (.prg) extensions
. Source files may be specified with or without the
(.prg) extension
. Drive designators and path references are ignored
Options: <options> are switches that configure the compiler's
behavior during compilation. When specifying options,
they must be lower case, separated by a space, and
prefaced with a dash character (-). The options are as
follows:
(-l) No Line Numbers
(-l) excludes the program's source code line numbers from
the object file reducing the object file by three bytes
for each line containing a program statement.
Note: The debugger relies on line numbers for
critical information regarding program errors.
Therefore, this option should not be used if you intend
using the Clipper Debugger.
(-m) Compiling a Single Program File
(-m) directs Clipper not to compile any program files or
procedures called within the specified program file.
This feature is useful for making changes to a single
program file without having to re-compile the entire
application.
(-o) Move Object File
(-o) directs Clipper to create the object file in another
directory. To specify this option, include the switch
and the path specifier on the Clipper command line as
follows:
C>CLIPPER <filename> -o <path>
(-p) Pause
(-p) loads the compiler and then pauses.
(-q) Suppress Line Numbers
(-q) suppresses line numbers from displaying on the
screen while compiling. Line numbers in the source code
are not affected.
Program Syntax Check (-s)
(-s) suppresses the creation of an object file. Use this
mode to check for syntax errors. To syntax check the
only current program file, add the (-m) option to the
compiler command line.
Return code: Returns 1 if the were any compile errors, 0 if the
compile was successful.
Description: The Clipper compiler converts source code written in
Clipper (or the dBASE III PLUS programming language) into
Intel object code files. The source code programs are
identified by the DOS filename extension (.prg). Object
code files are identified by the DOS filename extension
.OBJ. These object files can be linked with a linker to
produce an executable file, identified by the DOS
filename extension .EXE.
All program and format procedure files referenced in the
program file are also compiled and become a part of the
object file if there is no script file specified or the
(-m) option is not used.
Notes: . How Clipper compiles: If script file and/or the
(-m) option is not specified, Clipper compiles the
specified program file and all subsequent program files
referenced with DO, procedure files, and format files.
Within each file, any other files referenced are also
compiled until the entire system of source files is
processed. This proceeds according to the following
rules:
. The program specified on the compiler command line is
compiled first.
. Procedure files, procedures referenced with DO, and
format files in the current program are compiled in
the order specified.
. Procedure references made with DO and not already
compiled are compiled if found as (.prg) files in the
current directory. If not found, Clipper returns the
warning message "cannot open, assumed external."
. Format references made with SET FORMAT and not
already known must have the (.fmt) extension. If a
procedure with the same name as a format reference
has already been compiled, the format will refer to
the compiled procedure and not to the (.fmt) file on
disk.
Note: A DO requires the procedure either be known
or available in the current directory as file of the
same name with a (.prg) extension. If the procedure is
called with function calling syntax and not known,
Clipper does not search the disk a program file of the
same name, but instead assumes the procedure is
external and proceeds without any warning message.
. File extensions: If the reference is made to any
file from a DO or function calling syntax, the
extension is assumed to be (.prg). If the reference is
with SET FORMAT, the extension is assumed to be (.fmt)
unless the reference is in a script file. In this
case, the extension must be (.prg). If the reference
is with SET PROCEDURE, the procedure file must have an
(.prg) extension.
. Trapping compiler errors in a file: If an error
occurs during compilation, an error message displays on
the screen. To direct these messages to a file, use
the DOS redirection. For example, the following
compiler command line,
CLIPPER <program file> > ERRFILE.TXT
directs the compiler output into a file called
ERRFILE.TXT.
----------------------------------- Examples -------------------------------
The following compile command line checks the syntax of current
program file without displaying line numbers:
C>CLIPPER Test -s -q -m
.
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson