
                ͻ
                 TOPSPEED / CLARION PROJECT SYSTEM 
                ͼ

This is intended to be (unofficial and untested) documentation of the
TopSpeed and Clarion project system

If you discover any errors in these files, please send corrections
and additions to me rather than distributing a modified version, so
that all may benefit from your contribution.
Similarily, if you have any additions, find any spelling mistakes, etc.
then please contact me at:

        Clarion Software (Europe) Ltd
        Clare House
        Thompsons Close
        Harpenden
        Hertfordshire
        AL5 4ES
        UNITED KINGDOM

        Voice           +44 (0)1582 763999
        Fax             +44 (0)1582 768222
        BBS             +44 (0)1582 769666
        CIS             76711,1101
        Internet        76711.1101@compuserve.com


Paul Attryde
Clarion Software TopSpeed Technical Support
Revision 01



                         Ŀ
                         Overview
                         

The Clarion and TopSpeed products differ in the way that they
use the project system.  Clarion only uses a subset of the
system, which obviously causes problems for experienced
TopSpeed users who expect to be able to use the whole language
syntax.

In effect, the project system is (yet another) language used by
the TopSpeed and Clarion products, much like the template
language is yet another language used by Clarion.

A project file consists of a sequence of commands, which are
processed sequentially by the Project System. Commands are
made up from keywords (which all begin with #), strings, and
symbols.

The following characters form symbols in the project language,
and may only occur in a project file where the syntax of the
project command in question permits, or within quoted strings:

( ) < > , / =

The following keywords are recognized by the Project System :

#abort              #expand       #older
#and                #file         #or
#autocompile        #getkey       #pragma
#compile            #if           #prompt
#declare_compiler   #ignore       #run
#dolink             #implib       #rundll
#edit               #include      #scan
#else               #link         #set
#elsif              #message      #split
#endif              #model        #system
#error              #noedit       #then
#exemod             #not          #to
#exists

A string consists of a sequence of characters, delimited by
spaces, or by any of the special characters mentioned above.
A string may also be enclosed in single or double quotes, which
may include any characters. The quotes do not form part of the
string.

A comment is introduced by two "-" characters, and terminated at
the end of the line.

IE
-- this whole line is a comment
#compile fred.c -- this part line is a comment



                        Ŀ
                        Macro Expansion
                        

A sequence of characters enclosed by % characters indicates a
macro name. The second % may be omitted provided that the
character following the macro name is not one of the characters
below. The following characters are permitted in macro names:

        A B C D E F G H I J K L M
        N O P Q R S T U V W X Y Z
        a b c d e f g h i j k l m
        n o p q r s t u v w x y z
        0 1 2 3 4 5 6 7 8 9 _

Whenever a macro name is encountered, it is replaced either by
the string which has been associated with that macro, or by an
empty string if there is no such associated string.
Two adjacent % characters may be used when a % character is
required in a string. This is most often used for delaying macro
expansion.

For example:

        #set echo = '#message % %mymac'
        #set mymac = 'Hello'
        %echo
        #set mymac = 'World'
        %echo

executes the commands:

        #message Hello
        #message World

If a single % had been specified in the first #set command, the
macro %mymac would have been expanded (to the empty string)
before defining the replacement text for the macro %echo.

Ŀ
#SET


 #SET string=string

The #set command associates the macro name specified by the
first string with the second string. Any previous setting for
the given macro is lost.

Note: The macro name on the left should not be delimited by %
      characters.

For example:

        #set cwindow = jpi
        #set linkit  = '#link myfile'
        ...
        #if '%cwindow'=jpi #then
            #pragma link(CS_GRAPH.LIB)
        #endif

Clarion normally makes far more use of this macro, because the
user does not normally edit the project file manually, and has
to depend on the environment.  Some uses of #SET that Clarion
uses (as of 3009) are

 #SET CMDLINE                to set command-line parameters when
                             running a program from the environment





                        Ŀ
                        Compiling and Linking
                        

The primary purpose of most project files is to create one or
more executable or library files, while performing the minimum
set of recompilations and relinks necessary to ensure that the
target files are consistent with the current versions of the
corresponding source files.

A typical project file, therefore, consists of a number of
commands to specify the options to be used when compiling and
linking, followed by one or more #compile commands and finishing
with a #link command.

The Project System maintains a list of those files which are to
be used as input to the linker the next time an executable or
library file is created. This list is known as the link list.
A filename may be added to the link list using the #pragma link
command.

For example:

        #pragma link (mylib.lib)

However, it is seldom necessary to use #pragma link explicitly,
as all the predefined TopSpeed compilers add the resulting
object file to the link list whenever a source file is compiled.
In addition, when the #link command is encountered, all required
standard library files, and other object files which are
imported by those already on the link list are also added to
the list. The link list is cleared after each link.

Ŀ
#COMPILE


 #COMPILE <File-name>
            [#to <file-name>] [/<pragma> {,<pragma>}]
           {,<file-name> [#to <file-name>] [/<pragma>
           {,<pragma>}]}

The #compile command causes each nominated source file to be
compiled (if necessary). The name of the object file may be
specified using #to. If this is omitted, the name is derived
from the source filename, with the extension .obj.

Any pragmas specified in a #compile command apply only to the
single source filename that precedes the / character.
The macro %make is set to on if a compile is necessary, off
otherwise. The macros %src and %obj are set to the names of the
source and object filenames.

Each object file is added to the link list, i.e. there is an
implicit:
        #pragma link( %obj )

For example:

        #compile fred.c #to fred.obj
        #compile george.cpp /debug(vid=>full)

It is possible to reconfigure the behavior of the Project System
when compiling source files of a given extension using the
#declare_compiler command (see later in this chapter). This may
also be used to declare actions to be performed for different
file extensions  for example, to support third-party compilers
or preprocessors.

Ŀ
#LINK


 #LINK <file-name>

The #link command links together (if necessary) all the files
in the link list to the nominated executable or library file.
The file type is determined by the extension of the nominated
target file, or, if there is no extension, by the file type
specified in the most recent #system command. If neither is
specified, the default is to produce an executable file.

The #link command differs from the similar #dolink command in
that (so far as the project system can determine), any
additional object files required are automatically added to the
link list before linking. This includes any TopSpeed library
files, and also (via an implicit #autocompile command) all
modules imported via IMPORT clauses in Modula-2 or Pascal, or
via #pragma link statements in C or C++ source files. In
addition, #link will determine from the target file type and
memory model any additional processing that needs to be applied
to the output file, for example, when producing an executable
file for Windows or in overlay model.

The action of the #link command may be reconfigured by altering
the contents of the Project Link section of the configuration
file TSPRJ.TXT. The effect of #link is to set the macro
%link_arg to the specified filename, then execute the sequence
of project file commands in that section of the configuration
file.

For certain specialized requirements, the use of #link may be
inappropriate - for example, if a specialized startup file is
required, or when building library files, where explicit control
of exactly which files are included may be preferred. In such
cases, the #dolink command should be used.

Ŀ
#DOLINK


 #DOLINK <file-name>

The #dolink command takes the object files which have previously
been added to the link list, and combines them into an
executable or library file (depending on the extension of the
nominated target file), if required to keep the target file up
to date. No additional files are added to the link list, so all
required files must have been specified previously, by means of
#pragma link, #pragma linkfirst, #compile, and #autocompile.
For simple projects, the use of #link is preferable.

Ŀ
#AUTOCOMPILE


 #AUTOCOMPILE

The #autocompile command examines the object files which are
currently in the link list, to see which objects they need to
be linked with. This would include objects specified using a
#pragma link in a C or C++ source file, or in the case of
module based languages such aS Modula-2 and Pascal, imported
modules.

Each resulting object file, if not already in the link list, is
then compiled (if necessary) and added to the link list. If
there is more than one possible source for a given object file,
an error is reported. This process is repeated until the link
list stops changing.

It is not necessary to use #autocompile for simple projects
where #link is used rather than #dolink, as #link performs an
implicit #autocompile.

Ŀ
#IMPLIB


 #IMPLIB <file-name> [ <file-name> ]

The #implib command is used to create (if necessary) a dynamic
link import library file. There are two forms of this command,
which operate in slightly different ways. If a single filename
is specified, this names an import library file, which is
created (if not up-to-date) from the object files on the link
list. The object files are scanned and each public function or
variable is exported. For example:

        #pragma link( fred.obj, joe.obj )
        #implib mylib.lib

In the second form of the #implib command, an import library
filename and a module definition file (.exp) are both specified,
and the library file is created (if not up-to-date) from the
symbols named in the definition file. This form of the command
is equivalent to using the tsimplib utility - see the "TopSpeed
Advanced Programmer's Guide" for further information.

        #implib <expfile> <libfile>

Using #implib in the second form requires you to create and
maintain the list of exports 'by hand', whereas the first form
exports all public names automatically. The use of a module
definition file is an advantage if you need to maintain
compatibility with previous versions of an interface, and it
also allows you to export only the functions which need to be
exported.

The Microsoft implib utility must be used if you require that
the .lib file created be acceptable to the Microsoft linker.

Warning: When making DOS DLLs, a feature of the TechKit, a module
         definition file must be created.

Ŀ
#EXEMOD


 #EXEMOD <file-name> <file-name> <file-name>

This command is the equivalent of using the TSEXEMOD utility,
required to make advanced overlay model programs, Windows
programs and DOS DLLs.

It is not necessary to use this command explicitly when making
overlay model programs, unless the advanced features available
to the TechKit user are required. This command's facilities are
documented fully in the "TopSpeed Advanced Programmer's Guide".



                   Ŀ
                   Compiler And Linker Options
                   

Whenever a file is compiled or linked, the current settings of
the compiler or linker options are compared to those used when
the file was last compiled or linked, to determine whether the
file is up to date. If a compilation or link is necessary, the
current settings are passed on to the compiler or linker to
determine its behavior appropriately.

Compiler and linker options are specified by means of the
#system, #model and #pragma commands.

Ŀ
#SYSTEM


 #SYSTEM string [ string ]

The #system command is used to specify the target operating
system and file type. The macros %system and %filetype are set
to the first and second arguments. The #system command will
affect the behavior of subsequent #model and #link commands,
and so a #system command must have been specified before either
of these.

The first argument specifies the target operating system, and
may be DOS, OS2, WIN (for Windows) or auto (to indicate that the
target is the same operating system as is currently being run).

The second argument indicates the target file type, and may be
EXE, LIB, or DLL. If omitted, EXE is assumed.

Ŀ
#MODEL


 #MODEL string [ string ]

The #model command is used to specify the memory model to be
used for subsequent compilations and links. This memory model
will continue to be used until modified by explicit pragmas, or
by another #model command.

The first argument specifies the model (small, medium etc), and
must be present. The second indicates the calling convention,
which may be jpi or stack. If omitted, jpi is assumed.

Note: The behavior of the #model command may be configured using
      the Project Model section of the configuration file
      TSPRJ.TXT. The effect of a #model command is to set the
      macros %model and %jpicall to its first and second
      parameters respectively, and then execute the sequence of
      project commands found in the Project Model section of the
      configuration file.

The #system command must be specified before the first #model
command.

Ŀ
#PRAGMA


 #PRAGMA <pragma> { , <pragma> }

The #pragma command modifies the state of the pragma options
which affect the behavior of the TopSpeed compilers or linker.

The special macro %pragmastring expands to the current state of
all pragma options which are not in their default state - this
can be useful for determining exactly which options are being
used for a given compilation.

For example:

        #message '%pragmastring'

will display the current pragma state in the message window.

Ŀ
#IGNORE


 #IGNORE <file-name>
 #IGNORE pragmastring

There are two forms of the #ignore command. The first, where a
filename is specified, tells the Project System to ignore the
date of the nominated file when deciding whether or not to
compile. This is useful when a 'safe' change is made to a
widely used header file, to prevent mass recompilation.
!

The special form #ignore pragmastring  directs the Project
System to ignore the pragma settings when deciding whether or
not to compile a file. This may be useful, for example, when a
new compile-time macro has been defined, but there is no need
to recompile everything.



                        Ŀ
                        Boolean Expressions
                        

Ŀ
#OR


 boolean_expression ::= <factor> { #OR <factor> }

A boolean expression containing one or more #or operators yields
true if the evaluation of any of the factors yields true.

Ŀ
#AND


 <factor> ::=   <term> { #AND <term> }

A factor containing one or more #and operators yields false if
the evaluation of any of the terms yields false.

Ŀ
#NOT


 <term> ::= #NOT <term>

A term preceded by the #not operator yields true if the
evaluation of the term yields false, and vice versa.

Ŀ
Comparison Operator


<term> ::= string = string

A term containing a comparison operator yields true if the
strings are identical, otherwise false.

The = operator and second string may be omitted, in which case
the first string is compared against the string "on".

The first string may be replaced by an expression of the form
name1(name2), where name2 names a pragma of class name1. In this
case, the expression is replaced by the current setting of the
specified pragma, before the comparison is made.

Ŀ
#EXISTS


<term> ::= #EXISTS <file-name>

A term containing the #exists operator yields true if the file
exists (after applying redirection to the filename), otherwise
false.

Ŀ
#OLDER


<term> ::= <file-name> #OLDER <file-name> { , <file-name> }

A term containing the #older operator yields true if the first
file specified is older than at least one of the other files
specified, otherwise false. Redirection is applied to all
filenames. This operator is often useful to determine whether a
post/pre-processing action needs to be performed.

For example:

        #if mydll.lib #older mydll.exp #then



                        Ŀ
                        File System Commands
                        

These commands are all prefixed by the keyword #file, and handle
the interface to the DOS/OS2 file system with TopSpeed
redirection built-in. Redirection applies to all filenames
mentioned. The syntax and semantics of the file system commands
are as follows.

Ŀ
#FILE COPY


 #FILE COPY <src-filename> <dst-filename>

This command causes a file to be copied from <src-filename> to
<dst-filename>. Both <src-filename> and <dst-filename> must be
filenames without wildcard characters. Redirection is applied to
both filenames.

Ŀ
#FILE DELETE


 #FILE DELETE <filename>

This command causes the nominated file to be deleted. <filename>
must be a filename without wildcard characters. Redirection is
applied to the filename.

Ŀ
#FILE MOVE


 #FILE MOVE <src-filename> <dst-filename>

This command moves (renames) a file from <src-filename> to
<dst-filename>. Both filenames must specify files on the same
drive. Redirection is applied to both filenames.

Ŀ
#FILE TOUCH


 #FILE TOUCH <filename>

This command sets the date and time of <filename> to be the
current date and time.

Ŀ
#FILE APPEND


 #FILE APPEND <filename> <string>

This command appends the specified string to <filename>,
followed by a CR/LF pair. The file will be created if it does
not exist. This command can be used to build up log-files.

Ŀ
#FILE REDIRECT


 #FILE REDIRECT [ <filename> ]

This command changes the current redirection file to <filename>.
If no filename is specified, then the redirection file is
restored to its value on entry. At the end of the project file,
the redirection file is restored to its previous state.

Ŀ
#FILE ADDERRORS


 #FILE ADDERRORS <filename>

This command processes the error messages in the nominated
file, and adds them to the errors that will be reported when the
project terminates.

Each error message must in one of the following formats :

        (filename lineno,colno): error string
        (filename lineno): error string
        filename(lineno): error string

To capture errors from a program with a different error format,
a filter program can be used to translate them. For example:

        #run 'masm %f; > %f.err'
        #file adderrors %f.err
        #run 'myprog %f; | myfilter > %f.err'
        #file adderrors %f.err

If any errors are detected, and abort mode is on (see the #abort
command below), the project will terminate and the errors will
be reported in the error editor window.

The macros %errors and %warnings are set to the number of errors
and warnings detected.

Ŀ
#FILE PROMPT


 #FILE PROMPT <promptstring> [ <defaultfilename> ]

This command prompts for a filename in the same way that the
TopSpeed Environment does. If wildcards are entered then file
selection windows are opened to choose the required file. The
file entered or selected is returned as the value of the macro
%reply.

For example:

        #file prompt 'File to run: ' *.exe
        #run %reply



                        Ŀ
                        Editor System Commands
                        

These commands are all prefixed by the keyword #edit, and handle
the interface to TopSpeed Environment Editor. These commands
have no effect when a project is executed from the Batch System.

Ŀ
#EDIT SAVE


 #EDIT SAVE <filename> [ #to <filename> ]

This command causes the nominated file <filename> to be saved if
it is present in any editor window. You are not prompted to
confirm that the file should be saved. If #to is specified, the
file can be saved with a different name.

Ŀ
#EDIT SAVEALL


 #EDIT SAVEALL

This command causes all edited files in all windows to be saved,
without prompting.

Ŀ
#EDIT SAVEWIN


 #EDIT SAVEWIN <winnum>

This command causes the contents of the specified window to be
saved. <winnum> must specify a number between 0 and 9. This
command is generally used to save system editing windows 0 or 9,
before loading another file into them (see below).

Ŀ
#EDIT LOADWIN


 #EDIT LOADWIN <winnum> <filename>

This command loads the nominated file into the specified window,
and moves the window to the top of the window stack. If the
window previously contained an edited file, the contents (and
any edits) are lost.

Ŀ
#EDIT REFRESH


 #EDIT REFRESH <filename>

This command causes the editor to reload the specified filename
from disk if it is present in any editing window. This is
usually called when a file has been changed, to ensure that the
latest version is on display in the editor.

Note: Changes to the file within the editing window will be
      lost, so the command should be used with care.

Ŀ
#EDIT OPEN


 #EDIT OPEN <winnum> [ <filename> ]

This command terminates the current project and enters the
specified editor window. If a filename is specified, then it
will be loaded into the editor window. If window 0 is specified
and no filename is supplied, the error editor will be entered
in the first file to have errors reported on it.



                      Ŀ
                      Miscellaneous Commands
                      

Ŀ
#MESSAGE


 #MESSAGE <string>

This command displays the specified string in the make display
window. This can be used to indicate progress through the
project file, or to display status messages.

Messages are only displayed in make or link mode. When running
under the Batch System, messages are suppressed if the quiet
command-line switch is specified (/zq).

For example:

    #message "finished making %prjname"

Ŀ
#ERROR


 #ERROR <string>

This command terminates the current project. Under the
TopSpeed Environment, the error editor is opened at the position
of the #error command, and displays the supplied string as the
error message. Under the Batch System, the error is displayed in
the standard TopSpeed format.

For example:
    #if "%name"="" #then
        #error "name not set up"
    #endif

Ŀ
#ABORT


 #ABORT [ on | off ]

This command is used to control whether a failed compilation or
#run command will terminate a project. If abort mode is on, a
project will be aborted as soon as a compilation fails, or a
#run command produces a non-zero return-code. If abort mode is
off, a project will only be aborted if an internal command
fails, including a #link, #implib or #exemod command.

#abort on will set abort mode to on, while #abort off will turn
it off. #abort without one of the above arguments will abort the
current project immediately.

The default abort mode is on when running under the TopSpeed
Environment, and off when run from the command line.

Ŀ
#PROMPT


 #PROMPT <promptstring> [ <defaultstring> ]

This command prompts you to enter a string, displaying
<promptstring>. If <defaultstring> is specified, this will be
used as the default value presented. The string you enter is
returned as the value of the macro %reply.

For example:

    #prompt "Command line: " %cline
    #set cline = %reply

Ŀ
#GETKEY


 #GETKEY <promptstring> [ <keysstring> ]

This command displays the specified prompt string, and waits for
one of the keys specified in <keysstring> to be pressed. If
<keysstring> is not specified, this command waits for Escape to
be pressed.

The macro %reply is set to the character of the key pressed.
For example:

        #getkey 'Abort/Retry/Quit?' 'ARQ'
        #getkey "Errors found, press escape"

Ŀ
#RUN


 #RUN <commandstring> { <runoption> }

This command executes the command specified by <commandstring>.
Various options may be specified after the command string, from
the following list:

pause           prompts for escape to be pressed after the
                program finishes executing, before continuing
                executing the project file.

timed           times the execution of the command, and displays
                the elapsed time before continuing.

                Note: Built-in commands (DIR, COPY etc.)
                cannot be used with this option.

swap            swaps the TopSpeed Environment out of main
                memory before executing the command (DOS only).

fail_abort      aborts the project if the program returns a non
                zero DOS return value.

rte_abort       checks for the occurrence of run time errors,
                and will abort the project if they occur, and
                try to find the error in the source (if debug
                information is turned on).

                Note: Built-in commands (DIR, COPY etc.)
                cannot be used with this option.

no_abort        non-zero return codes will not cause the project
                to be aborted.

session         under OS/2 this will cause the program to be run
                in a separate OS/2 session. This command has no
                effect when used under DOS.

no_window       will not clear the screen before executing the
                file. Any output from the program will garble
                the screen.

For example:

        #run "dir > dir.log"
        #run "myprog" pause rte_abort

Note:   Filenames within the command string (with the exception
        of the executable filename itself) are not automatically
        subject to redirection - #expand may be used before
        using #run if this is required.

The use of the no_abort, rte_abort and fail_abort options
overrides the current setting of the #abort switch (see above).

Ŀ
#INCLUDE


 #INCLUDE <file-name>

A copy of the contents of the nominated file is inserted in the
input stream. <file-name> should specify a valid filename, which
will be redirected using the current redirection file.

Ŀ
#EXPAND


 #EXPAND <file-name>

The filename is subjected to redirection analysis, and the
following macros are defined:

%cpath  is set to the fully expanded filename where the file
        would be created.
%opath  is set to the fully expanded filename where the file
        would be opened.
%ext    is set to the extension of the filename.
%tail   is set to the filename, less extension, drive and path.
%cdir   is set to the directory where the file would be created.
%odir   is set to the directory where the file would be opened
        for read

For example, suppose the redirection file has the line,

        *.def : . ; c:\ts\include

and the file c:\ts\include\io.def exists, and the current
directory is d:\test then,

        #expand io.def

is equivalent to,

        #set opath = d:\test\io.def
        #set cpath = c:\ts\include\io.def
        #set ext   = .def
        #set tail  = io
        #set odir  = d:\test\
        #set cdir  = c:\ts\include\

Ŀ
#SPLIT


 #SPLIT <file-name>

The filename is split into its base and extension. The following
macros are defined:

%ext    is set to the extension of the filename.
%name   is set to the filename, less extension.

For example:

        #split d:\name.exe

is equivalent to,

        #set ext   = exe
        #set name  = d:\name

Ŀ
#SCAN


 #SCAN <file-name>

This command may be used to speed up a project where a large
number of source files are involved. All files found via
redirection which match the nominated filename (which should
include wildcards), are added to the Project System's file
date cache. If only a small percentage of the files visible
(via redirection) are actually used in the make, using #scan
may not be worthwhile.

For example:

        #message "Scanning..."
        #scan *.def
        #scan *.mod
        #message "Done"

Ŀ
#DECLARE_COMPILER


 #DECLARE_COMPILER string = string

This defines a macro (the second string) which is is invoked
when compiling source files with an extension matching the first
string. The macros %src and %obj are set to the names of the
source and object files.

Generally, you will not have to use this command explicitly, as
all TopSpeed compilers (and other common cases such as MASM) are
pre-declared in the Project Predefined section of the
configuration file TSPRJ.TXT, which is implicitly included at
the top of every project.

For example, the following is an extract from the standard
TSPRJ.TXT:

        #declare_compiler mod=
        '#set make = %%remake_jpi
        #if %%make #then
            #rundll TSMOD %%src %%obj
        #endif
        #pragma link (%%obj)
        #set tsm2=on

Ŀ
#RUNDLL


 #RUNDLL string string string

This command invokes an integrated JPI compiler/utility. The
first string is the DLL name, the second is the source filename,
and the third is the output filename.

You should never have to use this command explicitly, as all JPI
compilers/utilities are pre-declared in the Project Predefined
section of the configuration file TSPRJ.TXT, which is implicitly
included at the top of every project.



                     Ŀ
                     Error And Warning Macros
                     

The commands #rundll and #file adderrors set the values of the
macros %errors and %warnings to indicate the number of errors
and warnings detected.

These macros may be inspected in order to determine the status
of the make after one of the above commands:

For example:

        #if #not %warnings=0 #then
            #getkey "Press E to edit, C to continue" "EC"
            #if %reply = E #then
                #edit open 0
            #endif
        #endif



                     Ŀ
                     Special Project Macros
                     

A number of macros are used for special purposes by the Project
System, and you should avoid defining macros of the same name
inadvertently. Similarly, you should not define macros using
trailing underbars.

The following is a list, in alphabetical order, of all such
macros:

%action         set to make, link, compile or run, depending on
                the mode of invocation.

%C              set by the #model command to either F to
                indicate the stackframe calling convention or an
                underbar to indicate the standard TopSpeed
                calling convention. This macro is used by the
                #link command when determining library
                filenames.

%cdir           set by the #expand command.

%cgraph         set to either jpi or borland, to indicate which
                version of the C graphics library to use. This
                macro is set automatically when you include one
                of the relevant header files, and is used by the
                #link command to determine what library to
                include.

%clapfx         Clarion prefix for libraries/DLLs. Takes the
                values:

                DXV    Static (XLARGE)
                DOV    Overlay (OVERLAY)
                DEV    Protected mode (EXTENDED)
                DDV    Overlay + runtime (DYNALINK)
                DES    Protected mode + runtime (EXTENDLL)

%compile_src    in compile mode, this is set to the name of the
                file to be compiled, with path and extension
                where available. Otherwise, it is set to the
                empty string.

%cpath          set by the #expand command.

%cwindow        set to either jpi or borland, to indicate which
                version of the C text windowing library to use.
                This macro is set automatically when you include
                one of the relevant header files, and is used by
                the #link command to determine what library to
                include.

%devsys         set by the TopSpeed Environment to DOS, OS2 or
                WIN, depending on the development operating
                system, and examined by the #system command.

%editfile       set to the name of the file being edited in the
                topmost window. If no window is open, or in
                batch mode, it is set to the empty string.

%editwin        set to the window number (0-9) of the topmost
                window. If no window is open, or in batch mode,
                it is set to the empty string.

%errors         count of errors produced by preceding
                compilation or #file adderrors command.

%ext            set by the #split and #expand commands.

%filetype       set by the #system command to its second
                argument, and examined by the #link command.

%jpicall        set by the #model command to its second
                argument, and examined by the #link command.

%link_arg       set to its argument by the #link command.

%M              set by the #model command to a single letter to
                indicate the memory model in the filename of
                library files, and examined by the #link
                command.

%main           set to the assumed name of the main source file.
                In make or link mode when not using UNNAMED.PR,
                this is derived from the project filename, with
                path and extension removed. Otherwise, it is the
                supplied source filename complete with path and
                extension if specified.

%make           set to on or off by the #compile, #link and
                #dolink commands, to indicate whether the target
                file was up to date.

%manual_export  you should set this macro to on to indicate that
                the #link command should not construct a .LIB
                file when a DLL is linked. If this macro is not
                specified, a .LIB file will be created
                automatically from the corresponding .EXP file
                (if found), or from the object files in the link
                list.

%model          set by the #model command to its first argument,
                and examined by the #link command.

%name           set by the #split command.

%O              set by the #model command to W, P or R to
                indicate Windows, Protected mode or Real mode.
                The #link command uses this to derive the name
                of any required library files.

%obj            set to the object filename in a #compile
                command.

%odir           set by the #expand command.

%opath          set by the #expand command.

%pragmastring   will always expand to the current state of the
                pragma settings - this is useful for debugging.

%prjname        set to the assumed name of the project - this is
                usually derived from the project filename, but
                with the path and extension removed. Where
                UNNAMED.PR is being used, it is derived from
                main source filename without source and
                extension.

%remake         used within declare_compiler macros to determine
                whether source/object dependencies require a
                remake.

%remake_jpi     used within declare_compiler macros to determine
                whether source/object dependencies require a
                remake. %remake_jpi should be used for object
                files created by TopSpeed compilers, which
                contain additional information.

%reply          set by the #prompt and #getkey commands.

%src            set to the source filename in a #compile
                command.

%system         set by the #system command to its first
                argument, and examined by the #model and #link
                commands.

%tail           set by the #expand command.

%tsc            set to on if a C or C++ source is compiled.

%tscpp          set to on if a C++ source is compiled.

%tsm2           set to on if a Modula-2 source is compiled.

%tspas          set to on if a Pascal source is compiled.

                The above language macros are examined by the
                #link command to determine which libraries to
                include, and then set to off.

%tsmode         set to either BAT or ENV, depending on whether
                the Project System was being invoked in batch
                mode or from the TopSpeed Environment.

%warnings       count of warnings produced by preceding
                compilation or #file adderrors command.






