Generic Language Support
Updated 01/01/98

NOTE!

This document describes version 5.0 of Codewright. Earlier versions may
have different steps required to install and configure the language support
module.

INTRODUCTION

This archive (currently named GENICL50.ZIP) contains source code for a
generic Codewright language support DLL. It does not contain any predefined
keywords, templates, or a comment character. Both 16- and 32-bit DLLs are
provided, so re-compiling the module is not necessary. You can adapt the
XXX.DLL module to support a number of languages with ease.

The source code supplied in this archive also serves as a good example of
how to write a module for languages which are too complex for XXX.DLL to
support without additional code. This file only describes configuring the
included DLL without recoding. If you would like more information on the
source code, check out "Adding Language Support to Codewright", a Quicknote
available from our web site (http://www.premia.com/).

INSTALLING XXX.DLL

First, you need to select the appropriate library to install. The 16-bit
library is WIN16\XXX.DLL, while the 32-bit library is WIN32\XXX.DLL. Copy
the correct file into your main Codewright directory.

Next, launch Codewright if it is not already running. Select "Tools |
Libraries" from the menu. This should display the "Load Codewright DLL"
dialog box. Click on the "Add" button. The standard Windows file open
dialog should appear. Locate and select XXX.DLL and click on the "Open"
button.

XXX.DLL should now appear in the "User Defined Libraries" listbox. Click
on "Ok", and the library should now be loaded.

DEFINING FILE EXTENSIONS

The XXX.DLL module can apply to any file type that you want, dependent on
the extension of the file. First, we need to create a ".XXX" extension.

Select "Document | Language" from the Codewright menu bar. The "Language"
dialog should appear. Click on "New Type", enter "XXX", and then click
"Ok". This extension should appear in the list of file types.

Now, you can create other extensions that you want the XXX configuration
to apply to. Just click on "New Type", enter your extension in the dialog
that appears, and click "Ok". Now, highlight the extension you just added
in the "File Type" listbox, and click on "Map Type To". When the dialog
prompts you, enter "XXX" and click on "Ok".

DEFINING KEYWORDS FOR CHROMACODING

You can define any number of keywords that you would like to have Codewright
highlight in a color different than the standard text color, to make them
stand out.

First, go to the "Document | Language" dialog box, and click on the
"Keywords" tab. Select ".xxx" in the list of file types on the left.

You can define up to three different sets of keywords (named "Default",
"User 1", and "User 2"), each of which is colored differently. The process
of defining each set is the same, just click on the radio button that
corresponds to the appropriate set.

The first time you define a set of keywords, you must specify a file that
the list will be stored in. To do this, click on the "Browse" button. This
will display the standard Windows file open dialog. If you like, you can
enter a custom filename, or just click "Open" to accept the default.

Now, click on the large edit box to the left of the "Browse" button, and
enter your keywords, one to each line.

DEFINING TEMPLATES

Codewright allows you to define templates, if the extension is backed by
a support module that supports it. XXX.DLL does support this capability.

To define a template for .XXX files (and all file types mapped to it),
select the "Templates" tab in the "Document | Language" dialog box. Now,
enter the "trigger" text into the "Keyword Abbreviations" edit box, enter
the template to be associated with this trigger in the "Template" edit
box, and click on apply.

For more information on templates, including special characters and macros,
see the on-line documentation for "ExtExpandTemplate", or the Codewright
User's Guide.

TURNING TEMPLATE EXPANSION ON

In the "Document | Language" dialog, with ".xxx" selected in the list of
file types, click on the "Edit" tab. Check the "Template Expansion"
checkbox. If you don't have this option checked, your templates will not
function!

DEFINING THE COMMENT CHARACTER

XXX.DLL supports only one comment format. You specify a certain character,
and anything following this character to the end of the line will be treated
by Codewright as a comment.

To set this up, you must edit your CWRIGHT.INI file manually. It is a good
idea when doing this to not have Codewright running, and edit the file with
another ASCII text editor like NOTEPAD.

Once you have CWRIGHT.INI open in an editor, locate the section heading
"[Editor]". After all other entries in this section, create a line that
reads "XXXSetCommentChar="?"". Here is an example of using a semicolon:

        [Editor]
        ...
        XXXSetCommentChar=";"

Save the file.

YOU'RE DONE!

Now launch Codewright, and you should have keyword, template, and comment
support for files that end with ".XXX" and any other extension you have
mapped to ".XXX"!

ANOTHER NOTE

All changes you wish to make to the configuration of keywords, templates,
etc., should be done with the ".xxx" file type selected. These changes will
be applied to all other file types mapped to ".xxx".
