2/27/2001	Updated documentation for CodeWright 6.6.  Added new loading
			instructions.

Starbase Note:
This DLL was provided by a customer.  Other than providing a
working DLL for the current release, support for the code is
limited.

            Dynamic Link Library (DLL) to Add Support for the
                Modula-2 Language to CodeWright vers 3.0g
                           (August 9, 1994)
                                 by
                          Gerald A. Szekely


   Although I spend the majority of my programming time working in
C/C++, about 20% percent of my coding work is done in FORTRAN and
another 20% in Modula-2.  I also occasionally program in Pascal and
Assembly Language.  Trying to keep the functions and capabilities of
five separate editors fresh in my mind (along with the coding syntax of
each of these languages), was overwhelming.  I decided I had to find
one editor that I could use that would allow me to edit source code for
each of these programming languages.  Several years ago I bought the
Brief editor, which is a DOS based program.  With Brief, I was able to
use the built in code templates for each language I programmed in.
Also, I was able to set up the Brief editor so that it could compile
code from each of the languages I programmed in, and jump to the lines
with coding errors.

   Ever since Windows 3.1 came out I have been looking for a Windows
editor with Brief like features that would work with the five languages
I program in.  Several weeks ago I bought a copy of CodeWright for
Windows vers 3.0g, and because it came with a Brief keyboard interface,
I was productively writing code with CodeWright the day I installed it.
I especially like the "Chromacoding" and the language template
expansion features of CodeWright.

   After using CodeWright on a C++ project, I couldn't go back to using
the DOS-based version of the Brief editor when it came time to work on
a Modula-2 coding project.  However, since "Chromacoding" and the
language template features for the Modula-2 language where not included
with CodeWright, I decided to add them.  I began by starting with the C
source code for the Pascal language which Starbase did include with
CodeWright.  My resulting effort is included in the file mod.c, and the
compiled DLL is in mod.dll.  I compiled mod.c using Borland C/C++ vers
3.1, and the required make and link files are also included.  Copy the
mod.dll file to your \cwright\ directory.


   To use the Dynamic Link Library for the Modula-2 language with CodeWright
your cwright.ini file must be modified. To add this dll in CodeWright 6.6 select
Customize|Libraries and click on Add. Browse for Mod.dll and click OK. CodeWright 
5.0, 5.1 and 6.0 have a similar dialog that will automatically load the dll for 
you. Go to Tools|Libraries or Tools|Customize|Libraries and click on Add. Browse 
for Mod.dll and click OK. The preceding steps will add a libpreload entry to the 
[LibPreLoad] section cwright.ini,.  
My [LibPreLoad] section looks as follows:


[LibPreLoad]
;LibPreload=cwldraw.dll
;LibPreload=cwdde.dll
;LibPreload=prg.dll
;LibPreload=sc.dll
;LibPreload=cob.dll
;LibPreload=bas.dll
LibPreload=mod.dll

Add the .mod file type extension to Document|Language|Edit. Click on
"New" and type "mod" (without quotes) in the edit box.
  
To get CodeWright to recognize the .def definition modules, you have
to use extension aliasing which can be done in the Document|language|
Edit dialog. Click on "New" type "def" in the edit box. Once ".def" is 
in the list of file type extensions, highlight it and click "Map Type to".
In the edit box type "mod" (once again, without quotes). Do the same for 
the .def file type.

That's all there is to getting CodeWright to support the Modula-2
language.  I've included two Modula-2 source code examples so that you
can verify that the Modula-2 DLL is correctly working. The first
example called example.mod is an example implementation module, and
the second example called example.def is a definition module example.



