Generic Language Support
Updated 01/01/98
Updated 01/31/02 for 7.0.

NOTE!

This document describes version 7.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. Only a 32-bit DLL is provided,
so re-compiling the module is only necessary if a 16-bit version is needed.
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 Document
available from our CodeWright WebLibrary at www.starbase.com

INSTALLING XXX.DLL

Copy the 32-bit library (WIN32\XXX.DLL) into your main
CodeWright directory.

Next, launch CodeWright if it is not already running. Select "Customize |
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 "Customize | 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 "Customize | Language" dialog box, and click on the
"Coloring" tab. Select ".xxx" in the list of file types on the left.

Next, make sure "Language Dependant" is checked and "DLL" is chosen.  Now
click on the "Keywords.." button.

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