Documente Academic
Documente Profesional
Documente Cultură
8VHUV*XLGH
Copyright 1992-1996 Premia Corporation. All rights reserved. The following copyright message is required due to the inclusion of CTL3D.DLL with our product: Portions Microsoft Corporation, 1985-1995. All rights reserved.
Publication History
October, 1991 February, 1992 June, 1992 August 1993 August 1994 November 1995 January 1997 First Release Updated for 1.1 Updated for 2.0 Updated for 3.0 Updated for 3.1 Reformatted and updated for 4.0 Updated for 5.0
Trademarks
Premia is a registered trademark of Premia Corporation. Codewright is a trademark of Premia Corporation. Borland C++ and Brief are registered trademarks of Borland International. Microsoft is a registered trademark of Microsoft Corporation. Windows and Visual C++ are trademarks of Microsoft Corporation. Epsilon is a trademark of Lugaru, Inc. Other product names are the trademarks of their respective holders.
Premia Corporation 1075 NW Murray Blvd., Suite 268 Portland, Oregon 97229 Phone: (503) 641-6000 Fax: (503) 641-6001 BBS: (503) 646-1374 CompuServe: 70673,2627 Email: sales@premia.com or support@premia.com World Wide Web: http://www.premia.com
ii
Table of Contents
Selective Display ...................................19 Using Selective Display.....................19 Spell Checker ........................................19 Spell Check Dialog............................20 Spell Correction Dialog.....................21 Template Macros...................................22 Predefined Templates ........................23 Adding and Changing Template Definitions .........................................23 Using Macros in Templates...............24 User-definable Popup Menu..................27 Definition Sections ............................28 Item Definition Lines.........................28 Item Hot Keys ...................................28 Separator Lines..................................29 Supporting Functions.........................29 SEARCH AND REPLACE.....................31 Search and Replace Dialog....................31 Search Settings ......................................32 Replacement Options.............................33 Multiple Sources Search Dialog ............34 Advanced Multi-source Search Options 34 Edit Search List .....................................37 Incremental Searching ...........................38 ISearch Function................................38 Quick Search .........................................39 Toolbar Search ......................................39 DOCKABLE TOOLBARS AND WINDOWS ..............................................41 What Does Dockable Mean? .................41 Enabling and Disabling Toolbars ..........41 Docking and Moving Toolbars and Windows................................................42 Customizing Toolbars and Buttons .......42 Project Window.....................................43 File View Window ............................44 Outline Window ................................45 Bookmarks Window..........................47
INTRODUCTION...................................IX What Makes Codewright Different? ...... ix Basic Strategy ..................................... x User Compiled DLLs .......................... x Key Editor Features................................ xi About the Manuals ................................ xii Using this Manual ................................. xii Typographical Conventions .................xiii EDITOR HIGHLIGHTS.......................... 1 API Assistance ........................................ 1 Using the API Assistant ...................... 1 Modifying the Database ...................... 2 Automation Tools................................ 2 Browsing, Tags, and Outline Symbols .... 3 Which Type of Browsing Should I Use? .................................................... 3 Browser Support ................................. 4 Tags Support ....................................... 9 Outline Symbols................................ 10 Button links ........................................... 12 How it works ..................................... 12 What you see..................................... 12 Defining buttons................................ 12 View Links ........................................ 13 Mouse Commands................................. 14 Inclusive or Exclusive Selection ....... 14 Closed Selections .............................. 14 Column Marking ............................... 15 Line Selections .................................. 15 Word Selections ................................ 15 Status Line Actions ........................... 15 Text Drag and Drop .......................... 16 Mouse Copy and Move ..................... 17 Creating Windows with a Mouse ...... 17 Drag and Drop File Loading ............. 18 Expand / Collapse ............................. 18 Popup Menu ...................................... 18 Making Mouse Assignments ............. 19
iii
Table of Contents
Open File Window ............................ 48 Tabbed Output Window........................ 48 Select View via Tabs......................... 49 Associated Dialogs............................ 50 VDOS.................................................... 50 LANGUAGE FEATURES...................... 53 Document Settings ................................ 53 Document Language Dialog.................. 53 Associating File Types with a Language........................................... 53 Other File Type Specific Settings ......... 54 Editing the Extensions File................ 54 Function Definitions Outline................. 55 C Language Support.............................. 55 Brace Matching ................................. 55 Pre-processed View........................... 57 KEY COMMANDS ................................ 59 CUA Key Commands............................ 59 In the Beginning................................ 60 Advanced Stages ............................... 60 Codewright CUA Variant...................... 60 Persistent Selections.............................. 61 Disabling Virtual Space ........................ 61 CUA Commands by Category............... 63 CUA Commands by Key....................... 65 Making CUA Key Assignments ............ 67 CUA Keymap Functions ....................... 67 BRIEF Key Commands......................... 74 BRIEF-compatible Commands by Category ............................................ 75 BRIEF Compatible Commands by Key78 Brief Keymap Functions ................... 80 VI Key Commands................................ 84 Vi Modes........................................... 84 VI Command Summary..................... 84 Codewright Extensions...................... 89 EX Command Words Supported....... 89 Epsilon Key Commands........................ 90 Epsilon Keymap Functions ............... 99 VERSION CONTROL SETUP............114 Which Interface Do I Use? ..................114 Command Line Interface .....................115 Unlisted Providers ...........................115 Check In Command .........................115 Check Out Command ......................116 Check Out with Lock Command .....116 Lock Command ...............................117 Unlock Command............................117 Log Command .................................117 Manager Command .........................117 SCC Provider Interface .......................118 VCS Maintenance Dialog....................118 PROJECTS AND WORKSPACES .....119 What is a Project?................................119 What is a Workspace? .........................119 Creating a Project ................................120 Adding and Deleting Project Members120 Project Setup Checklist .......................121 Using Projects .....................................121 Selecting or Changing Projects........122 Loading Files for Editing.................122 Project Window...............................122 Creating a Workspace .....................123 Workspace Saving...........................123 Changing Workspaces .....................124 Searching Project Files....................125 Selecting files for Check-in or Checkout....................................................125 Project Files.........................................125 Configuration and State Hierarchy ......125 REGULAR EXPRESSIONS ................127 Special Characters ...............................127 Escape Sequences................................128 Matching a Character ..........................129 Character Classes ................................129 Escaping Characters in a Class ............130 Iteration Qualifiers ..............................130
iv
Table of Contents
Beginning and End of Line ................. 131 Alternation and Grouping.................... 132 Reference Groups and Replacement Strings ................................................. 133 Placing the Cursor ............................... 133 Examples............................................. 135 GENERAL OPERATION.................... 136 Backup Files and Directories .............. 136 Backup Formatting Strings.............. 137 Transformation Patterns .................. 138 Illustrative Examples....................... 139 Command Key..................................... 139 Command Completion .................... 140 Using the API.................................. 141 Source Code versus Command Key 141 Displaying Return Values ............... 142 Examples of Usage.......................... 142 Expression Evaluator ...................... 143 Line Drawing ...................................... 144 Menu Editor ........................................ 146 Menus.............................................. 146 Menu Items and Submenus ............. 147 Operating on Submenus .................. 148 Prompt Histories ................................. 148 CONFIGURATION AND STATE ...... 150 Introduction to Configuration and State151 Configuration File ........................... 151 State File ......................................... 151 Other Files Containing Configuration Data................................................. 152 Example File ................................... 152 Example Interpretation.................... 153 Processing At Startup.......................... 154 Order of Processing......................... 155 User Defined Sections......................... 156 Relating Checkboxes to Functions ...... 158 State File ............................................. 159 Contents of the State File ................ 159 COMMAND LINE PARAMETERS ...161 Filenames.............................................161 Flags ....................................................161 Command Files....................................166 APPENDIX A -- COLOR GUIDE .......167 Palette Settings ....................................168 APPENDIX B -- TECHNICAL SUPPORT ..............................................169 Web Page ............................................169 Internet Mail........................................169 CompuServe ........................................169 Fax.......................................................170 Phone Support .....................................170 Maintenance Policy .............................170 APPENDIX C -- UPDATING SOURCE WITH MERGE .....................................171 Steps to Merging .................................171 Identify Merge Candidates ..............172 Make the Source Files Available.....172 Install AutoMerge............................173 Define AutoMerge Directories ........173 Execute the AutoMerge Function ....174 Resolve Conflicts.............................174 APPENDIX D -- TAGSWNN UTILITY176 Usage...................................................176 TAGSWnn Command Line Options....176 APPENDIX E -- SPECIFICATIONS ..183 Line Length Limit............................183 Lines per Buffer Limit.....................183 Buffers Limit ...................................183 Windows Limit................................183 File Size...........................................183 Number of Files...............................183 Clipboard/Scrap Buffer Size............183 Search String Length .......................183
Table of Contents
FUNCTION REFERENCE.................. 187 Function Description Format............... 187 AssignMouseKeys............................... 189 AttrSetPaletteEntry ............................. 189 Autosave.............................................. 189 AutosaveDir ........................................ 190 BackTab .............................................. 190 BlockCopy .......................................... 190 BlockCut ............................................. 191 Brace ................................................... 191 BraceMatch ......................................... 191 BraceMatchNext ................................. 192 BufBackspace...................................... 192 BufDelChar ......................................... 193 BufDelLine.......................................... 194 BufDelSelection .................................. 194 BufDelToEOL..................................... 194 BufEditFile.......................................... 195 BufInsertChar...................................... 196 BufInsertEOL...................................... 196 BufInsertFile ....................................... 196 BufInsertScrap .................................... 197 BufInsertStr......................................... 198 BufSetAutoIndentMode ...................... 198 BufSetBackupSpec.............................. 199 BufSetGlobalBackupSpec................... 200 BufSetTabStr....................................... 201 BufSetTabUsage ................................. 202 BufWrite ............................................. 203 BufWriteFile ....................................... 203 BufWriteSelection............................... 204 CenterLine........................................... 204 CheckIn ............................................... 204 CheckInBuffer..................................... 206 CheckInSetCmd .................................. 206 CheckOut ............................................ 207 CheckOutBuffer .................................. 208 CheckOutSetCmd................................ 209 ClipboardEnableSepStr....................... 210 ClipboardSetSepStr............................. 211 ColorCommandLine ............................211 Color....................................................212 ColorError ...........................................213 ColorMessage......................................214 ColorWarning......................................214 ColorWarning......................................215 ConfigFileRead ...................................215 CWHelp...............................................216 DefaultKeymap....................................217 DeleteNextWord..................................217 DeletePrevWord ..................................218 DisplayFileName.................................218 Dlg.......................................................218 DlgMenuPopup ...................................220 DlgMenuExec......................................221 EditNextBuffer ....................................221 EditPrevBuffer ....................................221 EdVersion............................................222 ErrKmapAssign ...................................222 EvalStrAdd ..........................................223 EvalStrDel ...........................................223 ExecApp ..............................................224 ExecCommand ....................................224 ExecUserCmnd....................................225 ExecuteMacro......................................226 ExtAddKeyword..................................226 ExtAlias...............................................227 ExtAssignTemplate .............................228 ExtColors.............................................229 ExtColorsAssoc ...................................229 ExtCommentSearchLimit ....................230 ExtDelayedColoring ............................231 ExtExpandTemplate ............................231 ExtIndentEnable ..................................233 ExtIndentEnableAssoc ........................233 ExtKmapAssign...................................234 ExtReadKeywordFile ..........................235 ExtReadTemplateFile ..........................235 ExtSetDelimiters..................................236 ExtSetStyle ..........................................237 ExtSetTemplateMacro.........................238
vi
Table of Contents
ExtSetUpdateDelay ............................. 238 ExtSetWrap ......................................... 239 FFind ................................................... 240 FFindFile............................................. 240 FFindNext ........................................... 241 FFindPattern........................................ 241 FFindShow .......................................... 241 FGrepFile ............................................ 242 FGrepFlags.......................................... 242 FGrepNext........................................... 243 FGrepPattern ....................................... 243 FGrepScope......................................... 244 FGrepShow ......................................... 244 FileTabs .............................................. 244 FilterAdd ............................................. 245 FilterDeleteList ................................... 246 FontSelectMsg .................................... 246 GotoLine ............................................. 246 InsertMode .......................................... 247 ISearch ................................................ 247 KeyPlayback ....................................... 247 KeyRecord .......................................... 248 KmapAssign........................................ 248 LibAutoLoad....................................... 249 LibFunctionReplace ............................ 250 LibPreLoad ......................................... 251 LibUnLoad .......................................... 252 Lower .................................................. 252 MarkGoto............................................ 252 MarkRestorePos .................................. 253 MarkSavePos ...................................... 253 MarkSet............................................... 253 MenuCmnd.......................................... 254 MenuCommand................................... 255 MouseLeftDClick................................ 255 MouseLeftDown.................................. 255 MouseRightDown ............................... 256 MovDown ........................................... 257 MovEndWin........................................ 257 MovEOF ............................................. 257 MovEOL ............................................. 258 MovHome............................................258 MovLeft...............................................258 MovNextChar......................................259 MovPageDown....................................259 MovPageUp.........................................260 MovPrevChar ......................................260 MovRight ............................................261 MovTopBuf.........................................261 MovTopWin........................................261 MovUp ................................................262 MsgLevel.............................................262 MsgMessage........................................263 MsgPauseOnError ...............................264 NextWord............................................264 OutputFile............................................264 OutputWindow ....................................265 Paste ....................................................265 PrevWord ............................................266 Print .....................................................266 PrintFlags ............................................266 PrintFooter...........................................267 PrintHeader .........................................268 PrintLineInc.........................................268 PrintLineInc.........................................269 PrintMargin... ......................................269 PrintSelection ......................................270 QDefaultKeymap.................................270 Redo ....................................................271 Repeat..................................................271 ResizeWindow.....................................271 ScrapNext ............................................271 ScrapPrev ............................................271 ScrapSetCount .....................................272 SelectWord..........................................272 SetLineDrawBindings .........................272 SetLineDrawStyle................................273 SlideIn .................................................274 SlideOut...............................................274 Space ...................................................275 SrchFind ..............................................275 SrchQFlags ..........................................276
vii
Table of Contents
SrchSetFlags........................................ 276 SrchTranslate ...................................... 277 StateSetMarkLevel.............................. 278 SysBeep............................................... 279 SysCaretHeight ................................... 279 SysCaretWidth .................................... 280 SysExit ................................................ 280 SysQFlags ........................................... 281 SysSetCwd .......................................... 282 SysSetDefault...................................... 282 SysSetFlags ......................................... 283 SysSwapBlocks ................................... 284 Tab ...................................................... 285 Tabs..................................................... 285 TagFind ............................................... 286 TagIgnoreCase .................................... 286 TagPrompt........................................... 287 TagSetFile ........................................... 287 ToBottom ............................................ 288 ToTop ................................................. 288 Undo.................................................... 288 Upper .................................................. 289 Visibles ............................................... 289 WinScrollHInc .................................... 289 WinSetCreationPos ............................. 290 WinVisible... ....................................... 291 WinVisibleMarginColumn.................. 292 WrapEnable......................................... 292 WrapParagraph ................................... 293 WrapSetRightMargin .......................... 293 WriteBuffer ......................................... 294 ZoomWindow ..................................... 294 CHANGING AND EXTENDING CODEWRIGHT.................................... 295 System Overview ................................ 295 Core Services ...................................... 296 CWSTART DLL............................. 296 CWDIALOG DLL .......................... 299 CWHELP DLL ............................... 299 Keyboard Command Sets.................... 299 Supplemental Language Support .........300 Auxiliary Services ...............................301 Sample DLL ........................................302 Dissecting a Codewright DLL .............302 The _init Function ...........................302 Exporting Functions ........................303 Making Changes and Additions...........303 Changing Existing Functions...........303 Adding Your Own Functions...........304 Creating New Keymap Command Sets304 Keymap _init Function ....................304 Keymap Function ............................305 Flag Initialization ............................305 Basic Assignments...........................305 Keymap Specific Assignments ........306 Menu Accelerators ..........................306 Recompiling a DLL .............................306 Using and Modifying the Makefiles 306 Compile and Link Options ..............307 Link Libraries ..................................307 Using Your Own DLL .........................309 Installing Your DLL ........................309 INDEX....................................................311
viii
Introduction
Codewright is, in large part, an editor. It is the first professional quality, extensible, programmer's editor written from the ground up for Windows. Codewright is also your "Central Command". From it you issue commands to your generals in the field: your compiler, version control system, operating system, and more. Codewright blends powerful productivity tools and Windows resources with a command shell. The result is eminently usable.
ix
Codewright needs just one of these five components: an editor engine to perform basic tasks. Yet it provides the same capabilities and more. To be properly designed for Windows, Codewright had to avoid the weaknesses of Windows while taking advantage of its strengths. That meant using a different basic strategy.
xi
In short, you'll find Codewright to be the most powerful editing environment available on any platform.
xii
Typographical Conventions
Typographical Conventions
Becoming familiar with a few typographical conventions used in this manual will accelerate your understanding of the information presented. Several different typefaces are used to signal specific purposes. Courier Courier typeface is used to indicate something you might see on the monitor, such as a prompt, something you are asked to type, or the contents of a file. When a combination of a prompt and user input is shown, the response portion will appear in bold, as shown below: Command: just_do_it Times Bold Times Italic The Times Bold typeface is used for keywords and function names. Times Italic is used for names of parameters that you supply. It is also occasionally used for emphasis. Keystrokes are usually described using pictures of the keys which must be pressed. The example to the left depicts the control and shift keys and the right mouse button, all being pressed at the same time.
)6
xiii
Typographical Conventions
xiv
Editor Highlights
Codewright contains many fine features. Some of these, such as search and replace, version control, and projects, merit chapters unto themselves. Other equally important features require less description, and are described in this chapter.
API Assistance
You will find on the help menu the item API Assistance on... This item will provide you with help in completing a call to a subroutine or function, if such help is available. Currently, help is provided on the Windows API, Standard C Library functions, Microsoft Foundation Classes, and the Codewright API.
API Assistance
Using the Checkboxes The use of checkboxes in the API Assistant is usually associated with a numeric parameter, such as an integer. The values you check, as represented by the predefined labels, are ORed together in the resulting function call. If you are not familiar with the labels you require, press the Help button and locate the descriptions in the related help file.
Description Contains information about Windows API function calls Contains information about Codewright API function calls Contains information about Microsoft Foundation Classes Contains information about Standard C library functions
Automation Tools
A tool has been provided to take data, in one of several formats, and make entries in an API Assistant database. This enables you to automate the creation and update of an API Assistant database for an API or library for which support is not provided. You will need to create a method for getting the data into the proper format. This might be done using an AWK script on source files or DDE queries to InfoView. After doing this, the automation tool will do the work of actually creating or updating the database, based on this information.
Browser Window
The Browser is one of the windows available for viewing in the tabbed Output Window. It appears when you select Browse from the Project menu or when you select the Browse tab on the Output Window. The Browser is actually two windows side by side with its own tool ribbon at the top. The Tree window appears on the left and the Inspect window appears on the right. Press to receive help, press ; at any time to leave the Browser window and return to the current edit window. To close the Browser window, select Browser again from the Project menu.
Label Bitmaps At the beginning of each line of the tree is a bitmapped label identifying to what the information in that branch relates. A key to these labels is given below: Bitmap Description Root information coming from the database. Information pertaining to a file or module. Information pertaining to a class. Information pertaining to a function. A preprocessor macro definition. A type definition. Information pertaining to a variable.
Refer to this diagram as you read the descriptions below. Jump to Code After traversing the tree, you will usually want to go to the corresponding source. There are two Go to buttons on the Browser Ribbon that allow you to do this. If you wish to go to the source code represented by the selected tree node (usually a point of definition), (go to) button on the left of the Browser Ribbon. If you have you can press the selected a reference, a calling or called function in the Inspect window, you may wish to key (Go to from Inspect) to go to that reference or function. Simply press the pressing the J key will always take you to whatever is selected in the Tree window. String Search The String Search feature of the browser works like a grep or filter of information in the database. Use it to filter out extraneous information. It is one of the most useful features of the browser. To use the String Search feature, enter a string into the combo box on the browser ribbon. Unlike some other browsers, the string you enter will not be treated in a case sensitive manner, and a trailing wildcard will be assumed. That is to say, if you enter "dump", it will match strings like "Dump" and "dumpFile".
Each query dialog has a set of action buttons and filter check boxes. The filter check boxes apply only to the action buttons that are enclosed in the same group box. Therefore, in the example above, the check boxes apply only to the Used By and Uses buttons. The other action buttons operate independently of the filters. With all the filters enabled (all the check boxes checked), you may find that you have too much information to sift through to find what you are after. It is probably best to check the minimum number of boxes that fill your needs. The six Query Dialogs are as follows:
Purpose General inquiries about the terminals (leaves) on the tree. OOP class inquiries. Inquiries about functions. OOP friend class inquiries. Inquiries from the root of the database. Inquiries related to a module.
Letter F T M V C
Filter Objects Function references and definitions. Type references and definitions Preprocessor macro references and definitions. Variable references and definitions. OOP Class references and definitions.
Tags Support
Codewright has support for CTags and other Tags generating programs whose databases conform to the standard Tags format. The file TAGS.C in Codewright's CWSTART subdirectory contains the functions that support this capability, and also defines the standard Tags file format. In addition, Codewright comes with a built-in Tags database generation capability. This program produces both a standard Tags database and a compiled database The resulting compiled database may be used with Codewright's Browser in a similar fashion to a browser database. You can search the database and traverse its contents via a graphical tree. A standard Tags database adds browse-like capabilities to an editor that knows how to read and use the database. If you see the name of a function on the screen and need to know what that function does, the supporting functions allow you to jump directly to the file and line at which the function is defined. You may later return to your original location by changing back to the original buffer. Codewright is known to be compatible with the PCTags program from Moderne Software and GNU Tags, the former of which is available for download from our bulletin board system; the latter is supplied with Codewright. Tags Setup To get Codewright to generate and use a Tags database automatically requires that you follow a few simple steps: Create a project whose members are the files you want to scan for your Tags database. Begin by selecting New or Open from the Project menu. Define what files will hold your Tags data -- your standard Tags database and your compiled database for use with the Browser. These are the last two entries on the Directories tab of the Project Properties dialog. Enter a filename in the Browser database field that employs the .PTG extension rather than .BSC to avoid having the file overwritten by a browser database generator.
Using the Tags Database To use the standard Tags database, you need to have the function TagFind assigned to a key. The TagFind function looks at the word at the cursor and tries to find a match for it in the database. You can assign this function along with TagNext and TagPrev to keystrokes, if they are not already assigned. You do this through the Keyboard dialog on the Tools menu. To use the compiled tags database with the Browser, load the .PTG file with the Browser File Open dialog. You will then be able to traverse a tree of your tags database, search the database, and be able to do queries for functions and other objects except for friend classes. You will only be able to query definitions, however. References are not stored in the Tags database.
Outline Symbols
The Outline Window is a hierarchical view of symbols in Project files and any other files that are currently loaded. The references to symbols (usually function names, variable names and the like) are kept in a database that is generated in the background as you work. It does not rely on a database generated by compiling, and therefore works on code that has never been compiled. Parsers are provided for use with a variety of file types to generate the symbol databases. You can add parsers for use with the output window without compiling. An advanced knowledge of regular expressions, and some development effort is required, however.
10
File Type .BAS .C .COB .CPP .H .HTML .INI .JAVA .PAS .PRG
Parsers Declare, Function, Sub Function, Define Section, Division Function, Define, Class Function, Define, Class Function Section Function, Class Function, Procedure Function
These parsers are also available to any file types that have been mapped to the ones above (e.g., .HTM is mapped to .HTML).
11
Button links
Button links
Button links are special action buttons that Codewright lets you embed in your text files. You may use them to view bitmapped images, bring up a related document or spreadsheet, run a macro or just to make notes. To any other editor, it is still just a straight text file, and because the buttons are placed in comments, source code files compile as they normally would.
How it works
You select the type of link and the text that will appear in the button. Codewright uses this information to create an index entry for that text, and places it into the text file with a special 3 character prefix and suffix. Comment prefixes and suffixes are used as you indicate. The index entry refers to an entry in a database that indicates what the button link does.
Defining buttons
When you select Insert Link from the Edit menu, you are presented with a dialog that allows you to define a button link. You enter your buttons text (which must be unique), select the link type, and enter the appropriate text to be associated with the button. The nature of the associated text depends on which link type you select. Using buttons you can perform three different categories of actions:
12
Button links
Macros -- Macros allow you to execute any API command that is available interactively. The text associated with a Macro link is the function call. It is limited to a single function.
Pop-up notes
Pop-up note links come in two flavors: standard notes and to do notes. These two types of notes are essentially the same. Providing two link types for notes, however, gives the buttons a different appearance and allows you to sort to do notes separately from other notes, when viewing the list of defined links.
View Links
The View Links dialog lets you see what links are currently defined in the database, lets you edit their definitions, delete them, or go to the location in the file where the link is defined. The tree shows the six different types of links available, and allows you to view the links of each type. There is a folder on the tree representing each of the six types of links. When the folder appears disabled, this indicates that there are no links of that type defined. After you open a branch of the tree to view the list of links of that type, you may select a specific link. Once selected, you may edit the definition of that link by pressing the Edit button, go to the location where that link is defined by pressing Go To, or you may delete the link from the database.
13
Mouse Commands
Note: Deleting a link from the database does not delete the button part of the link from the text file. This is something that currently must be done manually. If you do not do this, your files and database will become out of sync.
Mouse Commands
You can probably guess most of the things that you can do with a mouse in Codewright: click on menus, select text and so on. There may be a few things that you wouldn't guess you could do with a mouse, and other things that you might suspect you could do but do not know how to do. It is those things that we will be covering in this section.
Closed Selections
You may elect to have selections that you make with the mouse be either closed or open when you release the mouse button. This is one of the System Options that you can set. Your keymap dictates the initial setting for this option. A closed selection means you will not change the selection size or shape when you move the cursor. Selections made with key commands usually are not closed. In this case, one end of the selection is defined by the cursor position, and it therefore moves with the cursor. Your keymap may have a command to toggle a mouse selection or other selection open or closed. You can do this with the )D command in the BRIEF-compatible keymap, and ) in the CUA keymap, for example. If you re-open a closed selection after moving the cursor away from the selection, the end of the selection moves to the cursor position, wherever it happens to be. The distinction between closed and open selections is not meaningful in the CUA keymap unless you have turned on persistent selections. Otherwise, CUA removes the selection, whether closed or open, whenever you execute an cursor motion command.
14
Mouse Commands
Column Marking
Making a column selection with the mouse is just as easy. Just click and drag with the right mouse button instead of the left. Column blocks are always inclusive, regardless of which keymap you are using.
Line Selections
There is an adjustable margin between the left edge of the buffer and the window border. You can use this area for making line selections. Clicking with the mouse in this space selects the line to the right. Clicking and dragging selects a series of lines -- even if the mouse happens to stray from the margin.
Word Selections
As with many Windows editors, double clicking on a word makes a selection encompassing that word. If you continue to hold down the cursor on the second click and drag it around, you can select in units of words. You may be familiar with this method of selection from one of several word processors.
Read-only/Read-write Toggle
Description Toggle between insert and overtype mode by clicking-right on the Ins or Ovr designation on the status line. Toggle between Read-only and Read/write status by clicking-right in the box to the left of the line number. The box may be blank or have a RO designation in it. This toggles both file and buffer status. Clicking-right in the Line number box brings up the Go to Line dialog. Clicking with the right mouse button in the message box at the left of the status line will cause the program to process the next Build error message.
15
Mouse Commands
A related command is the right mouse click on the Ribbon Search combo box. This is on the Standard Toolbar instead of the status line. A right click here brings up the Search Options dialog. This allows you to check or change the settings in preparation for using the Ribbon Search or other search mechanism.
3.
16
Mouse Commands
4. 5. Change the 1 to a 0. Press the Save to File button and then the Quit button.
17
Mouse Commands
window is also made visible in the new window. This means you will have at least two windows in which to view the current buffer. If you don't like this use of the left mouse button you can turn it off through the Environment dialog on the Tools menu. You will find it on the System tab..
Expand / Collapse
When you are using selective display mode, you can use a mouse for expanding and collapsing sections of text as you might the sections of an outline. The mouse command used for this is a double click with the right mouse button. See the description of "Selective Display" later in this chapter for more information about this use of the mouse.
Popup Menu
Whenever you click with the right mouse button, you get a popup menu in any of the four standard keymaps. (Not press and hold, but rather a quick press and release.) This popup menu is context sensitive, presenting different items depending on whether you are clicking in a regular edit window, or in the output window; whether you have a selection defined or none defined. The Popup menu is described more fully later in this chapter.
18
Spell Checker
Making Mouse Assignments
You can also make your own assignments to mouse buttons and combinations through the Keyboard dialog on the Tools menu.
Selective Display
Selective Display mode lets you focus by hiding text that is not of current interest. The text is still there, but you dont see it until you want to. There are several ways to select what text to make visible. You can specify a pattern and hide lines that contain text that doesnt match that pattern. In this case, the resulting view of the file looks something like grep output. You can similarly specify a pattern and hide lines containing matching text. There are also some other more complex operations predefined for your use. You will find all of these capabilities in the Selective Display dialog on the Text menu.
Spell Checker
Codewright Professional's spell checker has a 100,000 word dictionary and some "codesmarts" that make it useful for a variety of purposes. It will help you keep reports, code comments, and the messages your program displays looking professional.
19
Spell Checker
The Spell Check item appears on the Edit menu. The Spell check button will appear on the Toolbox when it is enabled. The spell checker relies on several dictionary files: DICT.D DICT.I DICT.S DICT.APP DICT.U Main dictionary data file. Main dictionary index file. Small word dictionary containing one and two character words. Application dictionary. User dictionary.
All of these files, except for DICT.U, are placed in your Codewright Professional home directory during installation. The file DICT.U is created when you first specify that a new word is to be added to the dictionary.
Suggest Alternate Spellings The Suggest Alternate Spellings check box determines, when the spell checker finds a word that is not in the dictionary, whether it lists similarly spelled words that are in the dictionary. This has the effect of slowing down the checking process, so you may want to omit this option when you know you will be checking a lot of words that are not in the dictionary.
20
Spell Checker
Restrict to Selection This check box is only available when you have selected a block of text. When a selection has been defined, a check in this box indicates that only words in the selection are to be checked. Restrict to Comments/Strings This option is normally only available when you have a file loaded that has one of the following extensions: .C, .H, .CPP, .HPP, .HXX, .CXX, .PAS, .INC, .ASM, .PRG, .SC. These represent the file types for which Codewright Professional understands comment structures and string constants. It is then able to differentiate between comments, strings and other code. When this box is checked, the spell checker operates only on the words in comments and strings. Restrict to Strings The option is the same as the one above, except that the spell checker limits itself to strings only. Check Document Button The Check Document button initiates a spell check on the current document, using the selected options. Check Word Button The Check Word button checks the spelling of the word at or by the cursor. Next Button The Next button initiates a spell check on the current document beginning at the cursor position and continuing through the subsequent text. This button is useful when you momentarily exit the spell checker to make manual corrections and then want to pick up the spell check from where you left off.
21
Template Macros
Add to User Dictionary When the spelling in the caption is correct and you wish to have the spell checker recognize the word in the future, press this button. The spell check then continues. The word will be saved to a special user dictionary at the end of the session. Correct button This button replaces the word displayed in the caption with the word in the Replace with edit box. The spell check then continues. Correct All button This button replaces the word displayed in the caption with the word in the Replace with edit box. The spell check then continues. If Codewright encounters the same misspelling again, it will correct the spelling in the same way without further prompting. Ignore button When you neither want to correct the spelling of the word in the caption, nor want to add the word to the dictionary, press this button. This is useful when the word is not expected to be repeated elsewhere. The spell check then continues. Ignore All button When you neither want to correct the spelling of the word in the caption, nor want to add the word to the dictionary, press this button. The spell check then continues. If Codewright encounters the same misspelling again, it will ignore it. Quit button This button discontinues the spell check session. It may be continued later by selecting the Next button on the Spell Check dialog.
Template Macros
Templates are useful in taking the drudgery out of repetitive tasks. The constructs used in programming lend themselves to a fill-in-the-blanks style of template. Codewright Professional supports this type of templates that are automatically triggered when you type a designated abbreviation. Codewright Professional's templates have a macro capability, however, that makes them the most powerful in the industry. You may be leaving great potential untapped if you just use templates for language constructs.
22
Template Macros
This section of the manual reviews how to create the type of template used for language constructs. It goes on to describe the advanced features provided by template macros.
Predefined Templates
Before you add or change a template, you need to know what templates are already defined, and what there definitions are. Since templates are associated with a specific programming language, Codewright Professional associates them with file types used in that programming language. You can therefore view the templates defined for a particular file type by selecting Template tab of the Language dialog on the Document menu. Here, you can view the abbreviations that trigger template expansion, and the string values associated with them.
Character \n & @ \c
Purpose New Line. Simulates pressing enter at this point. Specifies cursor position after template insertion. Issues a backspace. Insert 'c' literally, (e.g., \&, \@, \\)
23
Template Macros
\t Insert a tab.
Here are some sample template strings, to give you an idea of how these special characters are used to construct templates: "if (&)\n{\n}" "do \n{\n\t&\n}\n while( );" "for (&; ; )\n{\n}" Finally, here is how the complete ExtAssignTemplate line might look in your configuration file:
ExtAssignTemplate=".pas","proc","Procedure &();\nBegin\nEnd;"
This example adds a template for use when editing files with the extension .PAS. When the word "proc" is typed, followed by a space, a template for a Pascal Procedure is inserted in the document. The cursor is positioned at the point where the name of the procedure would be entered. The ExtAssignTemplate function is described in the Function Reference part of this manual.
24
Template Macros
can also contain Template macros. The file FUNCT.TPL is also simple, and it contains just one Template macro. To demonstrate the use of Template macros, we will add a few macros to this file. This is the contents of the file FUNCT.TPL: /* ** * * * * * * */ %qEnter function name:$ PARAMETERS: DESCRIPTION: RETURNS:
The second line contains the %q query macro, which requests the name of the function. Here is the modified version of the same file: /%rep*60 ** %qEnter function name:$ * * PARAMETERS: & * * DESCRIPTION: * * RETURNS: * * CREATED: %date %time * * BY: %eUSERNAME$ */ These are the macros that were added: %rep & %date %time %e This macro repeats the * character 60 times. This specifies where the cursor should be placed at the end of the insertion. This inserts the current date. This inserts the current time. This inserts the value associated with the specified environment variable, USERNAME. Again, the $ character is used to delimit the string.
25
Template Macros
* * * * * * * * * * * PARAMETERS: DESCRIPTION: RETURNS: CREATED: BY: milow 08/16/95 11:45:50
These are just a few of the things you can do with template macros. A table containing a complete list of the % macros available follows:
Macro form %colNum %date %db %dcNum %de %dlNum %dw %eEnVar$ %fFilename$
%home %lineNum %mdNum %meof %meol %mlNum %mrNum %muNum %Num
Description
Moves the cursor to column Num of the current line. Inserts a U.S. formatted date string at the current cursor position. (mm/dd/yy) Deletes to the beginning of the line. Deletes Num characters at cursor. Deletes to the end of the line. Delete Num lines, beginning with the current. Delete the word at the cursor. Insert the string value associated with environment variable EnVar. Insert the named file at the cursor. Any template macros within the file are also processed. Move the cursor to the beginning of the line. Move the cursor to the line named by Num. Move down Num lines. Move the cursor to the end of the file. Move the cursor to the end of the line. Move the cursor left by Num columns. Move the cursor right by Num columns. Move up Num lines. When Num is 0 to 9, it refers to a user-definable string that may be different for each extension. Any macros contained in these strings are also expanded. These definitions are normally stored in your configuration file or CWRIGHT.EXT. The macros 0 through 3 are used for custom indentation in predefined language templates. See ExtSetTemplateMacro. Higher numbered macros (10 through 31) are not extension specific, but are otherwise similarly definable. They are reserved for the use of individual users.
26
;----------------- Popup Menu sections ----------------[Utilities] Quick Search Check in Check out Match brace Match next brace EnTab DeTab Selective text Hexidecimal File comment Function comment ; SearchQuick ; CheckInBuffer ; CheckOutBuffer 1 ; BraceMatch 1 ; BraceMatchNext 1 ; EnTab ; DeTab ; BufSetCompact ; BufSetHexAscii
27
Real Comment
0x1708 0x1709
Menu Separator
Definition Sections
The popup menu definition file contains sections just like a Windows .INI file does. Each section begins with a section heading, a word or label enclosed in square brackets. The lines that follow the section heading describe the menu items that will appear on the popup menu, and what happens when you select each item from the menu. These are called item definition lines.
The two parts of the definition line are separated by a semicolon. This may appear to be a comment, but it is not. We therefore call this a pseudo-comment. For a line to be a comment, the semicolon must be the first character on the line. The rest of the line is then ignored. The part of the line in the pseudo-comment is the function call that Codewright will execute when you select the menu item to the right of the semicolon. This function call must be something that you could call through the Codewright function LibFunctionExec, or the API Command prompt. No variables, no nested function calls.
28
Separator Lines
Any line in a definition section that begins with a dash indicates that Codewright should place a separator line on the popup menu at that position. A line the full width of the menu will appear on the menu even if there is only a single dash on the line. Codewright will ignore the remainder of any line that begins with a dash.
Supporting Functions
There are two functions that support the operation of popup menus. They are as follows: DlgMenuPopup -- Use this function to assign a popup menu to a key or mouse click. DlgMenuExec -- Use this function to execute other sections within the CWRIGHT.MNU file.
These functions are further described in the Function Reference portion of this manual.
29
30
In addition, the Search Options dialog influences the various methods of search and replace described here.
31
Search Settings
Search and Replacement Edit Boxes The Search String and Replacement String edit boxes allow you to enter the pattern you want to match and the replacement string. You may only enter a replacement string when the Replace radio button in the Action group has been selected. Both of these edit boxes maintain a history of previous responses, which you may select by pressing the down arrow to the right of the edit box. Save Settings This check box is provided to save you from having to make a trip to the Search Options dialog whenever you want to make a change to the search settings. Settings are not immediately written to disk, however. Checking the box makes the current settings the default for the session. These settings are saved in the state file on exit, if you are employing one.
Search Settings
Search Direction You may elect to search forward from the cursor position or backward. Search Options This group of check boxes allows you to turn various search attributes on or off. These include: Ignore case. When this box is checked, uppercase characters or lower case characters will be matched. When it is not checked, the case of the characters in the specified search string is significant. Regular expression. When checked, this box indicates that the search pattern is a regular expression. Some of the characters in regular expressions are given a different meaning than they would have in an ordinary string search. This allows for more powerful searches. Maximal match A check in this check box indicates that regular expressions should match the largest possible unit. If this box is not checked, regular expressions will match the smallest possible unit, which in some cases may be 0 characters. For example, if the regular expression specifies matching 2 or more A's in a row (AA+), and the search encounters 5 in a row (AAAAA), what does it match? If maximal match is on, it matches five. If it is not, the search matches the first two.
32
Replacement Options
Whole word When the whole word box is checked, the pattern you are searching will not match strings that are only partial words. That is, the pattern must be preceded and followed by one of the following: Beginning of file or end of file Beginning of line or end of line Spaces or tabs Wrap at beginning/end A check in this check box indicates that you want to search the entire document. When the document extremity is reached (the beginning or end of the document, depending upon the direction of search), the search is continued from the other document extreme. The search concludes at the point at which the search began. Restrict to selection. This check box allows you to indicate whether you want the search to be restricted to the selection or marked block of text. If the box is not checked, the scope of the search is global. This option will be disabled if no selection is defined. Select matching string. This check box specifies whether the text that matches the search will be highlighted in a selection at the end of the search. The selection may be momentary, or may be retained so that you can operate on it (copy, cut, or replace). Retain selection. When the "Select matching string" box is checked, this check box indicates whether the selection that encompasses matching text is momentary or whether it is retained so that you may operate on it.
Replacement Options
The Range group of options is specific to the replacement operation. Prompted replacement. When this radio button is selected, you will be prompted each time text matching the search pattern is found. You may elect at that time to make or skip the replacement, or to cancel the search. The search continues until no more matches are found in the defined scope of the search, or you select cancel. Single replacement. When you select this radio button, the first occurrence of matching text is replaced without prompting. Global replacement. Selecting this radio button causes all occurrences of matching text within the scope of the search to be replaced without further prompting.
33
34
Multiple Source Mode Selection Project This option lets you search through files that are members of the current project. Documents only This option lets you limit the search to the list of currently loaded documents. Files and folders This option lets you search an arbitrary group of files in any series of folders. Enter a name for your search set in the edit box associated with this radio button, or select from the list of previously created search sets.
File Pattern You may use the File Pattern edit box for quick, ad hoc searches that you are not apt to repeat. It lets you specify a file type or series of file types to search without associating it with a search set name. While not as powerful as the Search list, it is simpler to use. Enter one or more wildcard patterns into this box. Separate multiple patterns with a semicolon. The File Pattern supplements the selected items on the Search list, if any. You may add it to the Search list by pressing the Add button. Note: The File Pattern, when specified, does not override the list of files in the Search list. If both are defined, the files in both the File Pattern and any selected members of the Search list are searched. Search List The initial contents of this box depends on which mode of search you have selected. If you have selected Project mode, the box will list the files in the current project. If you have selected Documents only mode, the listbox shows the list of documents currently open. When you select Files and Folders, the list reflects the search set shown in the
35
36
37
Incremental Searching
List Editing Buttons You may Add, or Delete members of the Source Patterns list. The Invert and Clear buttons assist you in selecting patterns on the list that you wish to delete. Invert reverses the selection; those items that were selected become deselected and visa versa. The Clear button deselects all the patterns on the list so that you can start selecting from scratch.
Incremental Searching
Incremental searches can save time and typing. This is because Codewright searches for the string as you are typing it in, rather than waiting for you to type in the whole word and press (. Many times the search function finds the string you are looking for without you having to type it all in. This results in a little savings of time and effort for you.
ISearch Function
The ISearch function performs the incremental type of search for you. It may already be bound to a key in your keymap, but if not you can easily add such a binding with the Keyboard dialog on the Tools menu. You can check the listings for your keymap in the "Key Commands" chapter of this manual. You begin the search by invoking ISearch; press &%L in the CUA keymap, for example. ISearch prompts you for the search string, and you begin typing. Keep in mind that ISearch always searches in a case-sensitive fashion. The case of the characters you type must agree with the case of the characters in the document, in order to match. When you type the first character, ISearch moves to the next occurrence of that character and highlights it. ISearch performs a search after each character you type, looking for the sequence of characters you have typed thus far. If it doesn't find a match, it issues a beep, and the character you just typed is removed from the search string. If you find you have mistyped, just backspace over the incorrect character or characters. As you remove characters from the search string, the cursor backs up to the position that first matched the characters that remain. Delete the entire search string and you will find yourself at the position where the search began. You cancel ISearch by pressing ;. At that time, the string you typed into ISearch is added to the search response history to make searching for that string again more convenient. You may also use the Quick Search feature to search for the word that is now at the cursor position.
38
Toolbar Search
Quick Search
The Quick Search facility is a function you can use to do an immediate search for the word at the cursor. In the default configuration, you will find this function assigned to the button on the Tool Ribbon, and assigned to the &%T key combination in the CUA keymap. Other assignments may be made, or readily changed.
Toolbar Search
"Toolbar Search" refers to the search capability built into the Tool Ribbon in the form of a drop-down listbox control. This provides the most immediate, convenient way to perform simple searches. To use the Toolbar Search, click in the Toolbar Search edit box and type in the string you wish to search for. This may be a regular expression pattern, if you have regular expressions turned on. Toolbar Search honors all of the settings in the Search Options dialog. As soon as you press (, the search commences. If Codewright finds a match, Toolbar Search will retain the focus. This gives you the opportunity to search again just by pressing ( again. Pressing anything else will cause Toolbar Search to lose the focus, and you are then able to edit at the position where the match was found. Toolbar Search maintains its own response history, to allow you to recall strings or patterns you previously typed. These are available when you select the down arrow to the right of the edit box and the history list drops down.
39
40
41
Select Buttons
When you select the tab marked Select Buttons, Codewright enters a special mode. The toolbars are temporarily inoperative, but you can drag and drop buttons from the dialog to any toolbar, or even drag buttons from one toolbar to another. You may rearrange
42
Project Window
buttons by dragging and dropping within the toolbar. To remove a button, just drag it off the toolbar and drop it away from any toolbar. If you drag from one toolbar to another, the function bound to that button moves with it. If you drag from the dialog, the button receives the default binding for that button. Use the Binding tab to view or modify these assignments. Default bindings for each button are kept in a resource description file. For example, the default buttons you see in the dialog and their bindings are kept in a file named CWBUTTON.BTN. It is formatted rather like an .INI file, and it tells Codewright about the resources in the DLL file.
Bindings
The Bindings tab lets you change what each button does. You begin using it by selecting a toolbar from the listbox. You can then cycle through the buttons on that toolbar until you get to the one you want to change. The three edit boxes below the toolbar listbox contain the bindings for each the button. The Text button only applies to buttons containing ordinary text not bitmapped images. The Function Binding field contains the function call to be executed when the button is pressed. This function call must conform to the rules of LibFunctionExec, or calling it through the API Command Key. The Tool Tip field contains the message that pops up when the mouse cursor pauses over the button.
Project Window
The Project window is one of the dockable windows provided with Codewright. Like the Output Window, it contains several tabs that let you view different information about your project files and even other files. These tab are: File View Window Outline Window Bookmarks Window Open Window
43
Project Window
File View Window
The File View Window lists the files in the current project in hierarchical form, and lets you operate on files or groups of files. Getting Started with the File View Window Select Properties from the Project Menu, and use the Files tab to add files to your project definition. If you have more than a few files in your project, you will probably find it useful to define some filters for your project, using the Filters tab. This allows the files to be listed hierarchically in the File View Window, rather than just appearing as one long list. For example, let us say that a C language project consists of some .C files, some .H files, a .DEF file, a .RC file, and a .MAK file. You could divide these into three groups by defining three filters: Description Source files Include files Other files File Spec. *.c *.h *.*
Set up this way, you would see three headings in the Project window, Source files, Include files and Other files. The *.c files would be listed under the Source Files heading, the *.h files would be listed under the Include Files heading and the rest of the files would be listed under Other Files. Because of the order in which the filters are defined, the Other Files category only lists the .DEF, .RC and .MAK file. Files are listed only once. If there is any overlap in the file specs of two filters, the intersection will appear in whichever filter category is listed first. File Icons Each file listed in the Project window is preceded by an icon. These icons tell you something about the files. An icon that looks like a page with the corner turned over represents a normal read/write file. If the file is read only, the icon appear in light gray or disabled colors. If the file is not present at the specified location, the icon is followed by an exclamation point.
44
Project Window
Operating on the files You may select any number files listed in the Project Window, using the rules for multiple selection listbox click on a single file, shift click a range of files, or add to the currently selected file with control click. After you have selected the desired files, just press ( to load them for editing. For a list of other operations available, click with the right mouse button on one of the selected files. Set up this way, you would see three headings in the File View Window, Source files, Include files and Other files. The *.c files would be listed under the Source Files heading, the *.h files would be listed under the Include Files heading and the rest of the files would be listed under Other Files. Because of the order in which the filters are defined, the Other Files category only lists the .DEF, .RC and .MAK file. Files are listed only once. If there is any overlap in the file specs of two filters, the intersection will appear in whichever filter category is listed first.
Outline Window
The Outline Window is a hierarchical view of symbols in Project files and any other files that are currently loaded. The references to symbols (usually function names, variable names and the like) are kept in a database that is generated in the background as you work. It does not rely on a database generated by compiling, and therefore works on code that has never been compiled. For many users, this will replace the normal uses of a Browser. Parsers are provided for use with a variety of file types to generate the symbol databases. You can add parsers for use with the output window without compiling. An advanced knowledge of regular expressions, and some development effort is required, however. See the Symbols tab of the Document Language dialog for further information. Using the Outline Window The Outline Window uses the Symbols tab in the Output Window and an edit window to let you investigate the code you are working with. In the window you will see a tree structure with a root for each of the files you currently have open. When you open each root, you will see a list of symbols found in that file, grouped by parser type.
45
Project Window
Symbol Window
Clicking on a filename or root opens that file for editing. A single click on a listed symbol shows references to that symbol in the Symbol Window tab of the Output Window. If there is just one reference in the symbols database, the source code at that location is shown in the Symbol window. If there is more than one reference, a summary of each reference is listed in the Symbol window. You can then select a reference of interest, and view that location in the source code by double clicking on that entry in the list. When you single click on a symbol listed in the Outline window, as described above, the view in your current edit window is not modified. This allows you to browse symbol references without losing your place. If you double-click on a symbol listed under one of the loaded files, your view in the current edit window moves to that location, in addition to listing references in the Symbol Window.
Auto-Expand/Collapse
When this checkbox, at the bottom of the Outline Window, is checked, changing from one document to another will close one list of symbols and open another for the newly current document. This saves a step when you want to view or jump to a symbol location. When the box is not checked, you control when the symbol lists open and close. Supported File Types Parsers are available for the following file types:
File Type .BAS .C .COB .CPP .H .HTML .INI .JAVA .PAS .PRG
Parsers Declare, Function, Sub Function, Define Section, Division Function, Define, Class Function, Define, Class Function Section Function, Class Function, Procedure Function
46
Project Window
These parsers are also available to any file types that have been mapped to the ones above (e.g., .HTM is mapped to .HTML).
Bookmarks Window
The Bookmark Window gives you a view of local and global bookmarks defined in your documents. Clicking on a bookmark moves you to the bookmarks document and location. Although the bookmark database may contain bookmarks for files that are not loaded, only bookmarks found in loaded documents are listed. The contents of the bookmarks database, and other bookmark options are found on the Bookmarks Tab of the Document Preferences dialog. Global Bookmarks Global bookmarks are listed under that heading, regardless of in which document they are found. The entry for the global bookmark shows: the bookmark number, its name, if one was given, and the name of the document in which it is found.
Local Bookmarks Local bookmarks are listed under the name of the document in which they are found. The entry shows: the bookmark number, its name, if one was given.
Auto-Expand/Collapse
When this checkbox, at the bottom of the Bookmark Window, is checked, changing from one document to another will close one list of symbols and open another for the newly current document. This saves a step when you want to view a list of bookmarks. When the box is not checked, you control when the bookmark lists open and close.
47
48
The Codewright output window may be opened explicitly, by selecting the Output item from the Window menu. There may be little to view in the output window, however, until you use one of the features that relies on it. If you use one of these features, the output window will open automatically when needed. Initially, the window uses the bottom portion of the Codewright client area, and effectively reduces it. This is its docked mode. It is convenient when you dont want edit windows overlapping the Output Window. You can view the output window and the file you are editing at the same time.
49
VDOS
Associated Dialogs
You can invoke the associated dialog for several of these output windows by using the mouse to right-click on the tab. The tabs that you can click on and their associated dialogs are listed below:
The Search dialog also can perform File Greps and sends output to the Search Tab window. See also Browser Support. See the description of VDOS for further information about the Build and Shell tabs.
VDOS
VDOS is a command shell that runs in a Codewright edit window. This facilitates cut and paste, re-executing commands and more. When VDOS is activated, it will intercept output from Compile, Make, Rebuild and other project commands, and put it in the Build buffer. Checking the No shell box next to any of these commands will disable the use of VDOS for that command. You can also directly interact with VDOS through the Shell buffer. You can do most things you might do in a DOS box using the Shell buffer, but there are a few special keystrokes that are also available: Highlight part of a line and press ( to execute it as a command. Highlight part of a line and press )( to copy the text to the command line at the end of the buffer for editing or use in a command. Press 68 or )F to copy the current selection to the clipboard.
VDOS has been tested for compatibility in a number of configurations. It appears to be compatible with Windows for Workgroups V3.11, even with 32 bit disk and file access turned on.
50
VDOS
You may view either the Build or Shell buffer by selecting the appropriate tab on Codewrights tabbed output window. When you first select the Shell tab on the output window, Codewright will automatically activate VDOS. If you are running Windows 3.x, the first time you use VDOS, it will offer to modify your SYSTEM.INI file for you to add a reference to the VxD in requires under 3.x. If you would like to do this yourself, just add a line like the one below to the [386Enh] section of your SYSTEM.INI file: device=c:\cwright\cwvdos.386 If you installed Codewright into a different directory, be sure to substitute the name of that directory for the one shown above. After adding this line, you will need to restart Windows for the change to take effect. Remove references to other redirectors from your command lines when you use VDOS. Programs such as FTEE are not compatible with VDOS.
51
52
Language Features
Codewright Professional's Language features are settings and support that vary with the extension of the file that you are working on. For example, you may want Word Wrap to default to "on" in files with the extension .TXT, but not in files with the .ASM extension. Many features can be turned on or off for any type of file you may be using. There are some features, however, that will only work for languages for which there is built-in support. Language templates and ChromaCoding, for example, require built-in support. You can create built-in support for additional languages, but this is not something you can do on the fly.
Document Settings
Since extensions apply to files, and files are loaded as documents, you will find that most extension specific features are document settings. In Codewright Professional there are two dialogs for document settings, both on the Document menu: the Document Preferences dialog and the Document Language dialog. Since you will find some of the same settings in both of these dialogs, you should note that the difference between the overlapping settings is largely a matter of scope. You control the settings for the current document, the default settings, and all user defined documents by selecting the Document Preferences dialog. Use the Document Language dialog to create settings that effect all documents of a certain file type, as indicated by its filename extension.
53
54
C Language Support
This sets the right margin mark at column 70, for files that have the extension .TXT. This leaves a little margin for our friends who are stuck in 80 column mode. What can you make file type specific? Most things. Just follow this guideline: if you can't set it as a document or window default, don't try and make it extension specific. In that case, it is probably global, and turning on for one extension will turn it on for all. For example, don't try setting the color of warning messages differently for .C files. It will change the color for all warning messages.
C Language Support
This section contains description of some functions and features that are specifically for C and similar or related languages. These things are not language sensitive, however, since they operate the same way regardless of the extension of the file on which you are using them.
Brace Matching
Brace matching is a function specific to certain programming languages, primarily C and C++. Brace matching support in Codewright comes in several forms: check the current buffer to see that braces are balanced. This form is useful for checking syntax. highlight the text between a set of braces. This form is useful in visualizing the scope of the block defined by the braces and indenting blocks. locate the matching brace and move to it, either momentarily or permanently.
55
C Language Support
These services are performed by functions assigned to keys or buttons. You may wish to customize these assignments or make new assignments. Key assignments may be made through the Keyboard dialog on the Tools menu. Button assignments may be made through the Toolbars dialog also on the Tools menu.
Brace Function There is a function supplied with Codewright that processes the current buffer, looking for unmatched curly braces. By default, the function will ignore any curly braces it finds in C language comments within the file. You can specify that all braces within the file are to be matched.
You invoke the Brace function through the API Command Key. By now, you know that this means pressing in the CUA keymap and in the BRIEF-compatible keymap. If you are using another keymap, you may have to select API Command from the Tools menu. Supposing that you wanted to match all curly braces within a file, you would respond to the Command: prompt in the following manner: Command: Brace TRUE If you wished to ignore braces in comments, you just omit the TRUE parameter, or supply FALSE as a parameter instead. The function shows its progress by displaying the number of the line it is processing on the status line. If the function finds an unmatched curly brace, the cursor is positioned on that curly brace.
Brace Highlighting There are two functions that help you examine or operate on the text between matching curly braces and parentheses. Both of these functions are available on the Codewright Edit toolbar, but may be readily assigned to keys or other buttons.
The first function is BraceMatchNext, which looks for the next left brace or parenthesis, locates its mate, and then highlights the text between them. On subsequent calls, this function will find pairs nested within the highlighted set, or a pair following the highlighted set. The second function is BraceMatch, which operates similarly to BraceMatchNext, except that it searches for a match to the brace at the cursor position. If the curly brace at the cursor is a left brace or parenthesis, the function searches forward for its mate. If it is a right curly brace or parenthesis, the function instead searches backward for the mate. If
56
C Language Support
neither a left nor a right parenthesis or brace is at the cursor position, the function searches forward for the next matching set. Note: Since BraceMatch looks at the current cursor position, it is not effective for highlighting a series of blocks in sequence. On subsequent calls to this function, BraceMatch "finds" the pair that is already highlighted.
If you omit the parameter to this function, it will look for braces only. Passing a non-zero parameter to either of these two functions will cause it to look for matching parentheses in addition to curly braces.
Brace Locating The function BraceFind is provided to allow you to locate the brace, parenthesis, or square bracket that is the mate for the one at the cursor position. It does not create a highlight, but just positions the cursor at the corresponding object. This function is also available on Codewright's Edit toolbar.
The function also has a "kissing" mode that can be activated by giving the function a TRUE or 1 value as a parameter. In this mode, the cursor moves to the corresponding object, but only momentarily. After a brief pause, the cursor returns to its original position. This provides a method of reassuring yourself that you are closing the block or clause you thought you were.
Pre-processed View
This feature is for C users that find their source files cluttered with #ifdefs. Now you can see your source code exactly as the compiler will see it, while you are editing it. Thanks to Selective Display Mode, the whole file is still there, but you don't have to look at the parts that don't apply. Just create your "defines" in the [Definitions] section of the configuration file, or interactively. Then use the Preprocess function in the Selective Display dialog and soon you'll be seeing just what you need to see. Youll find this dialog on the Text menu.
Freedom to #ifdef If you put more than a couple of #ifdefs and related pre-processor commands into a file, you will probably note that the readability of the file has diminished. It can sometimes get difficult, if not impossible, to tell what is "going on" in the file. Don't get us wrong; #ifdefs are very important and useful. If you aren't making extensive use of these preprocessor commands, maybe you should be. Now you can use them without any concern for their down side.
57
C Language Support
If you write applications that are to run on more than one platform, or if you write custom software for more than one company, #ifdefs help you avoid redundant maintenance. If you maintain separate versions of a file for each of several platforms or customers, you will need to change each version whenever you need to improve the code that is common to all of them. You can instead maintain different versions in a single file using #ifdefs. Then, if you have to change the code they share in common, you change it only once. Previously, you may have been reluctant to use a lot of pre-processor conditionals because of how confused the source code begins to appear. Whatever time you saved on redundant maintenance could be lost just trying to figure out confusing source code. Codewright allows you to get the full benefit from the use of pre-processor conditionals by letting you see clearly the code for just what you are working on.
Creating Definitions You use the functions EvalStrAdd and EvalStrDel to define and undefine the symbols you use in your #ifdefs. You can place these calls in your configuration file (CWRIGHT.INI), or execute them through the Command Key. Many times you will want to do a combination of both.
When placing these calls in your configuration file, put them under the heading [Definitions]. As an example of how such a call might appear, a definition of the symbol "MSWINDOWS" is shown below: [Definitions] EvalStrAdd=MSWINDOWS, 0 The meaning of the three parameters to the right of the equal sign are as follows: MSWINDOWS is the label being created. The value assigned to MSWINDOWS is 0. The value assigned to the symbol or label is immaterial, so long as you are using only the #ifdef and #ifndef constructs to evaluate this label.
If later we want to undefine this symbol through the Command Key, here is how we can do it: Command: EvalStrDel=MSWINDOWS
58
Key Commands
The Codewright editor is several editors in one. In its "standard" mode, Codewright is a Common User Access (CUA) compliant editor. If you have ever used a Windows editor before, such as NotePad or SysEdit, you will find that you can guess many of the basic commands. This command set offers a number of short-cut keystrokes to allow you to bypass the menus in most cases. Codewright offers alternate command sets that may be more to the liking of users whose roots are embedded in DOS, Unix and other non-Windows platforms. These alternate command sets imitate the commands used in the BRIEF editor so popular in the DOS development world, Epsilon, an EMACS-style editor, and vi, the standard editor under Unix. We have supplemented these command sets with a number of CUA commands. It should take very little urging to get those who used a similar command set under DOS to give this alternate command set a try. Note: You may occasionally find that you have inadvertently placed Codewright in menu mode by pressing and releasing the key. This commonly happens when you start to issue a command, but fail to carry through. You can tell this has happened when most keys that you type result only in a chirp, and a menu item appears highlighted. Pressing and releasing the key again will toggle you out of this mode.
This behavior is typical of Windows programs, but is made more of a hazard in the BRIEF-compatible keymap, due to its numerous commands that employ the key.
+ )6V )I
The keystrokes that you use most often should require pressing no more than two keys. Since the key is defined in CUA as a System key, very few commands can use that key. The common two key commands are therefore primarily the
Advanced Stages
It is not long, though, before you perform these common commands quite automatically, and there is no need for memory aids. At this second stage, mnemonics are needed for those once-in-a-while commands. You don't want to stop what you are doing to look up a command you use once every couple of days. If all the best mnemonics are used up by the stage 1 commands, only the more arbitrary assignments remain for the less common commands. The less frequently used commands often require that you press more than two keys. They attempt to maintain an easily remembered association at the expense of pressing another key. For this reason, many of the less common commands are the keys combined with a letter key.
)6
)V )P )D )I )]
60
Persistent Selections
The Codewright (CW) CUA keymap was designed at a time when Microsoft Word for Windows used to save a file. While the CUA keymap demonstrates our desire to keep up with the current interpretation of the standard, we have retained the CW CUA keymap out of respect for those whose fingers have come to rely on these keystrokes. We expect further divergence in the future.
6
Persistent Selections
The CUA convention is to have non-persistent selections. That is, selections disappear whenever you execute a motion command, such as pressing one of the arrow keys. Programmers often find this behavior unfamiliar and limiting. A number of the key assignments in the CUA keymap are ineffective when in this mode, such as toggling a selection open or closed. To assure flexibility, we have added the ability to disable this behavior of CUA. Selections will then not disappear when you move the cursor. You can open and close selections to extend them as you wish. If you wish to have your selections persist, place the following command in your configuration file (CWRIGHT.INI): [Editor] CUA_sel_persist=TRUE To try out persistent selections, you can execute this same command from the API Command key.
61
62
Editing
Delete character left Delete line Delete to end of line Delete next word Delete previous word Indent block Insert line Insert next literally Redo Redo Slide-in prompt Slide-out prompt
Cursor Motion/Scrolling
Beginning of line Bottom of file Cursor left Cursor right End of line Go to line (prompt) Go to mark (prompt) Line down Line up Make top of window Make middle of win. Page down Page up Scroll down one line Scroll up one line top of file Word left Word right Delete character
tG t u t v t. tT s t\ t! t t] tX uv t tF u
*[
Scrap/Clipboard
Copy to Copy to Cut to Cut to Paste from Paste from Toggle clipb./scrap
Search/Replace
Incremental search Kiss matching brace Match brace or paren Multibuf search again
63
System
API Assistant API interface Auto indent on/off Build current Compact Mode
tuT tuU tI d tL tP tE tO t tuH ur uq up uo tur tuq u u tu tu tuM tuE t [0..9] tuG tuX tD t! t
Selections/Marks
Begin sel., inclusive Begin sel., exclusive Begin selec., column Begin selection, line Close/open Selection Create comment Extend selection left Extend selection right Extend selection up Extend sel. down Extend sel. word left Extend sel. word right Extend sel. begin line Extend sel. end line Extend sel. beg. document Extend sel. end document Format columns Go to mark (prompt) Set mark Lower case selec. Upper case selec. Select all Slide-in prompt Slide-out prompt
Compile document Error list Help Hex Mode Insert mode on/off Load recording file Next error Play stored keys Playback keystrokes Print version Quit Record keys toggle Routines Text Mode Wrap paragraph Write recording file
sb j tuD tj tuF tk tup b tuK th tuo tu[0..9] i tuY se h tuJ tuW tuZ ti te tu tue tuQ tg tuS tu[ sc
Window
Close win. & document Close window only Iconify window Next window Next wind. & document Previous window Toggle visible whsp. Zoom window
64
document document
s ...... Undo sb........ API Assistant sc........ Zoom window se........ Quit s ........ Redo ........... Delete character left t........ Close document t........ Close/open Selection t........ Toggle clipb./scrap t^........ Match brace or paren. tD........ Begin column sel. t ...... Delete previous word tF........ Copy to clip/scrap tG........ Delete line t ........ Delete to end of line to........ Scroll down one line tH........ Open file t ........ Go to bottom of file tx ...... Insert line tI........ Find te........ Close wind. & tg........ Next wind. & th........ Load recording file ti........ Write recording file tj........ Build current tk........ Compile document tH........ Open file t ........ Go to bottom of file
document document
tx ...... Insert line tI ........ Find te ........ Close wind. & tg ........ Next wind. & th ........ Load recording file ti ........ Write recording file tj ........ Build current tk ........ Compile document
................ Open file
t ........ Go to top of file tL ........ Begin selec., inclusive t ........ Copy to tO ........ Begin selection, line tr ........ Word left tP ........ Begin selec., exclusive tQ ........ New file tS ........ Print tT ........ Insert next literally tU ........ Replace tq ........ Word right tV ........ Save tur... Extend sel. word left tuq... Extend sel. word right tuo... Next error tu ... Extend sel. beginning
document document
65
tuQ .. Next window tuR .. Change output name tuS .. Previous window tuT .. Quick search for word tuU .. Replace again tuV .. Search again tuW .. Text Mode tup .. Show errors tuX .. Upper case sel. tuY .. Print version tuZ .. Wrap paragraph tu[ .. Toggle visible whsp. tW........ Make line top of win. tX........ Undo tY........ Paste from clip/scrp tp........ Scroll up one line tZ........ Write selection/file
t[ ........ Cut to clip/scrp t\ ........ Redo t] ........ Begin excl. sel. t! ........ Slide-in prompt t ........ Slide-out prompt t[0..9] ........ Set mark ............. Delete character o ............. Line down .............. Go to end of line b ............. Help d ............. Search again h ............. Record keys toggle i ............. Playback keystrokes j ............. API interface ............. Beginning of line ............. Insert mode on/off r ............. Cursor left ............. Page down ............. Page up q ............. Cursor right u ....... Delete next word u ........ Cut to u ........ Extend sel. beginning line u ........ Extend sel. end of line u ........ Save file u ........ Paste from ur ........ Character left uq ........ Character right uv ...... Backtab/unindent v............ Tab/indent p ............. Line up t! ........ Slide-in prompt t ........ Slide-out prompt
66
The CUA_selection Function CUA Keystrokes that extend the current selection or create a new selection use the CUA_selection function. The functions that are in turn called by the CUA_selection function are, for the most part, ordinary motion commands. The pass-through function manages the creation and opening or closing of the selection. The CUA_deletion Function The CUA_deletion function manages the process of replacing a selection with what is typed or inserted. This behavior is part of the CUA standard. The function deletes the contents of a selection, if there is one, and then calls the inserting function to allow the insertion to take place. The CUA_motion Function As part of the CUA standard, a selection is removed, if an ordinary motion command is typed. Keystrokes that operate in this way pass the motion command through the CUA_motion function to allow it to remove a selection, if necessary.
There is also a pass-through function for CUA mouse commands, named CUA_mouse. This function manages the creation of mouse selections in a way that maintains compatibility with the other pass-through function that use selections.
67
68
69
Extends an existing selection to the current mouse position. CUA_next_winbuf Selects the next window, unless there is only one, in which case it selects the next document. CUA_open_line Inserts a new line at the end of the current line. CUA_playback Plays back the current keystroke recording.
70
71
72
73
Advanced Stages
74
Buffer/File
Change output name Close buffer Display filename List of buffers Next buffer Open file Previous buffer Print buffer Read file into buffer Save file Write selection to file
sR t s) sE sQ sH s sS sU sZ sZ
tE tW tF u tG tX t t tr tq
Cursor Motion/Scrolling
Beginning of line Bottom of file Bottom of file Bottom of window Bottom of window Column left Column right End of line Go to line (prompt) Go to mark (prompt) Left window edge Line down Line up
t t r q sJ sM u o p
Editing
Delete character Delete character to left Delete line Delete to end of line Delete next word Delete previous word Indent block by tab Indent block by space Insert line Insert next literally Redo
sG sN s t v tx sT s\
75
Selections/Marks
Begin selec., inclusive Begin selec., exclusive Begin selec., column Begin selection, line Close/open Selection Go to mark (prompt) Set mark
t! t sX uv t u
Scrap/Clipboard
Copy to Cut to Copy to Cut to Paste from Toggle clipb./scrap
sP sD sF sO tD sM sn k tZ sk tJ ux tQ tS sK sL j sh i sS sY s[ t[ h tU s]
System
API interface Backups on/off Compile buffer Display routines Expand/Collapse Next error Show errors Help Insert mode on/off Load DLL Load recording file Playback keystrokes Print buffer Print version Quit w/prompt Quit w/write Record keys toggle Repeat key action Shell Text Mode
Search/Replace
Ignore case on/off Kiss matching brace Quick search for word MultiBuf Search again Reg. expr. on/off Replace Replace Replace again Search Search Search again
76
uj si sb d e c u u u b u sc
Window
Borders on/off Create tiled edge Delete tiled edge Resize window Select win. at left Select win. at right Select win. above Next window Select win. below Zoom window
77
sT ............... Insert key literally sU ............... Read block from file sV ............... Search forward sW ............... Replace forwards sX ............... Undo last edit sY ............... Show program version sZ ............... Write block to file sZ ............... Write buffer to file s[ ............... Quit with query save s\ ............... Redo last Undo s] ............... OS Shell sn.................. Set bookmark
................. Delete character left
t! ............... Slide-in Prompt t ............... Slide-out Prompt t ............... Delete current buffer tD ............... Toggle block attach tE ............... Scroll to wind. bottom t .......... Delete word at left tF ............... Scroll to window center tG ............... Scroll down a line t .............. Bottom line of window tx ............. Open new line tf ............... Ignore case toggle tg ............... Regular expr. toggle tJ ............... Display routines t ............. Top line of window tr ............... Previous word
78
x.................... Insert new line b ................ Next window k ................ API interface c ................ Resize window d ................ Create tiled edge e ................ Delete tiled edge f ................ Search forward g ................ Translate forward h ................ Record keys toggle i ................ Play recorded keys
r ................ Column left ............ Page down ............ Page up q ................ Column right u .......... Right edge of window ux ......... Expand/Collapse uf ........... Search again ug ............... Replace again uj ............... Unload DLL u ............. Left edge of window u ............. Select adjacent win. u ............. Select adjacent win. u ............. Select adjacent win. u ............. Select adjacent win. uv ............. Outdent block by tab
................. Indent block by space
79
80
81
82
83
Vi Modes
VI Key Commands
In the commands listed below, escape key.
Vi Modes
Command Input Initial (Normal) mode. Other modes normally return to command mode upon completion. (escape) is used to cancel a partial command. Enter this mode by setting any of the following options: a A i I o 0 c C s S R. You may then enter arbitrary text. This mode is normally terminated by pressing ;. Reading input for : / ? or !; terminated by typing a (.
Last line
VI Command Summary
Examples
/text ................................................search for text :cmd ...............................................ex or ed command ..................................................quit, discarding changes :q! ^U ^D ....................................................scroll up or down 3dd.........................................................delete 3 lines ..............................................change word to new cwnew dd...........................................................delete a line dw..........................................................delete a word eas ....................................................plurals word (end of word; append s; escape from input state) h i k l .....................................................same as arrow keys, respectively ..................................................insert text itext ...............................................arrow keys move the cursor u.............................................................undo previous change x.............................................................delete a character ZZ..........................................................exit vi, saving changes
( ( ( ;
; 4<=5
84
VI Command Summary
Count Arguments
Numbers may prefix some commands, They are interpreted in one of these ways.
line/col number......................................z G I scroll amount.........................................^D ^U repeat effect ...........................................most of the rest
File Operations
:!cmd .............................................run cmd, then return .................................................edit alternate file :e # ......................................edit, starting at end :e + name ..............................................edit starting at line n :e +n ..........................................edit file name :e name :e! # ...............................................edit alternate file, discard changes ..................................................reload, discard changes :e! ...........................................specify new arglist :n args ...................................................edit next file in arglist :n ..................................................quit, discard changes :q! ...................................................quit :q ..................................................run shell, then return :sh ............................................position cursor to tag :ta tag :w name .........................................write file name :w! name ........................................overwrite file name :w! .................................................forced write, if permission originally not valid ...................................................write back changes :w ^G..........................................................show current file and line ZZ..........................................................if file modified, write and exit; otherwise, exit
( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (
In general, any command word (such as substitute or global) may be typed, preceded by a colon and followed by a carriage return.
Cursor Motion
h or ...................................................backward $.............................................................end of line ( .............................................................back a sentence ( .............................................................beginning of sentence ) .............................................................end of sentence ) .............................................................to next sentence + ............................................................next line, at first non-white
85
VI Command Summary
- .............................................................previous line, at first non-white [[ ............................................................previous section/function ]] ............................................................next section/function ^.............................................................first non white-space character ^B ..........................................................backward screen ^D..........................................................scroll down half screen ^F...........................................................forward screen ^H..........................................................same as backspace ^U..........................................................scroll up half screen {.............................................................back a paragraph {.............................................................beginning of paragraph }.............................................................end of paragraph }.............................................................to next paragraph 0.............................................................beginning of line B ............................................................back a blank-delimited word b.............................................................back a word E ............................................................end of a blank-delimited word e.............................................................end of word ......................................................return, same as + H............................................................top line on screen l or ....................................................forward L ............................................................last line on screen M ...........................................................middle line on screen n.............................................................repeat last or ? command N............................................................reverse last or ? command n|............................................................move to column n nG..........................................................go to the beginning of the specified line (end default), where n is a line number space......................................................same as space bar W...........................................................forward a blank-delimited word w............................................................forward a word or j ....................................................next line, same column or k ...................................................previous line, same column
( 5
< =
Searching
,..............................................................repeat inverse of last f F t or T % ...........................................................find matching ( ) { or } /pat ........................................................next line matching par /pat/+n...................................................n-th line after pat ............................................move pat line to bottom of window /pat/z; .............................................................repeat last f F t or T ?pat........................................................previous line matching pat ?pat?-n...................................................n-th line before pat a.............................................................append after cursor
86
VI Command Summary
A............................................................append at end of line fx............................................................find next x Fx...........................................................find previous x i .............................................................insert before cursor I .............................................................insert before first non-blank Rtext; ...............................................replace characters rx............................................................replace single char with x Tx .......................................................... move to character following previous x tx............................................................move to character prior to next x
Scrolling
^E ..........................................................scroll window down 1 line ^L ..........................................................clear and redraw window ^R ..........................................................clear and redraw window if -L is - key ^Y..........................................................scroll window up 1 line ...................................................redraw screen with current line at bottom of window z....................................................redraw screen with current line at center of window z. .....................................................redraw screen with current line at top of window z ..................................................use n-line window zn.
( ( ( (
Bookmarks
mx..........................................................mark current position with the ASCII lower-case letter x `x............................................................move cursor to mark x 'x ............................................................move cursor to first non-white space in line marked by x
87
VI Command Summary
Operators
Operators are followed by a cursor motion, and affect all text between the cursor's starting and ending position. For example, since w move's over one word, dw deletes the word that would be moved over. Double the operator, e.g., dd to affect whole lines.
! .............................................................fitter through command < ............................................................left shift > ............................................................right shift c.............................................................change d.............................................................delete y.............................................................yank lines to buffer
Miscellaneous Operations
C ............................................................change rest of line (c$) D............................................................delete rest of line (d$) J .............................................................join lines s .............................................................substitute chars (cl) S ............................................................substitute lines (cc) x.............................................................delete characters (dl) X............................................................delete characters before cursor (dh) Y............................................................yank lines (yy)
88
89
Cursor Motion/Scrolling
Backward sentence Backward sentence Backward word Backward word Beginning of line Beginning of line
t[,tE th t[,N t[,! t[, t[,V t[,tV t[,E t[,tY t[,tZ r tE s tsE s> sp
sD tp sE tr sr tD s tO o tQ sq tH s q tI tsI s@ so
Beginning of window Beginning of window Center window Down line Down line End of line End of line End of window End of window Forward character Forward character Forward level Forward paragraph Forward paragraph
Cursor Motion/Scrolling
Backward character Backward character Backward kill level Backward level Backward paragraph Backward paragraph
90
Editing
Backward delete character Backward delete character Backward kill word Capitalize word Center line Delete blank lines Delete character Delete character Delete horizontal space Enter key Fill paragraph Indent for comment Indent previous Indent region Indent rigidly Indent under Insert ascii Insert file Kill level Kill line Kill Region Kill sentence Kill word
91
Search/Replace
Find delimiter Incremental search Query replace Query replace
Regex replace Regex replace Regex search Replace string Reverse incremental search Reverse regex search Select tag file tag files
Selections/Marks
Exchange point and mark Highlight region Jump to last bookmark Mark paragraph Rectangle mode Set bookmark Set mark Set mark
Scrap/Clipboard
Append next kill Copy region Copy to scratch Insert scratch Yank Yank pop
92
System
End kbd macro Exit Exit level Find file Goto tag Grep
t[, t[, tsL t[,sL t[,Z tJ t> t[,t> tX s s e h sa tc t[,O tA tsA t[, tsA t[,tA t[,G
System
Abort Alt prefix Alt prefix Argument Argument Argument Bind to key cd Change modified Compare windows Count lines Ctrl prefix Ctrl prefix Ctrl prefix
Help Help Last kbd macro Last kbd macro Load bytes Make Name kbd macro Named command Named command Pluck tag Push Set comment column Set fill column Set variable Show bindings Show menu Show variable
t[, t[,tF t[,t] t[,tI t[, sh tB b te t[,H d t[,P t[,sQ s[ c t[, t[,tH t[, t[,I i f sc ti
93
Window
One window Previous window Previous window Shrink window Shrink window horizontally Shrink window interactively Shrink window interactively Split window Split window vertically Zoom window
t[, t[,tP tF g td
Window
Enlarge window Enlarge window Enlarge window Enlarge window horizontally Enlarge window horizontally Enlarge window interactively Enlarge window interactively Kill window Kill window Move to window Move to window Move to window Move to window Next window Next window Next window
t[,A t t[,A s t[,# t[, t[, t[,tG t[, t[,o t[,r t[,q t[,p t[,Q t[,R s
94
r o q p
............ Backward character ............ Down line ............ Forward character ............ Up line ............ Delete character ............ Beginning of window ............ Overwrite mode ............ End of window b ............ Help c ............ Named command d ............ Load bytes e ............ Bind to key f ............ Show bindings g ............ What is h ............ cd i ............ Set variable j ............ Undo k ............ Redo ............. Previous buffer ............ Next buffer ............ Next page ............ Previous page sp ....... Backward paragraph sr ....... Beginning of line sq ....... End of line so ....... Forward paragraph
horizontally
s s s s sa s> s@ s? s s s s s s s
....... Argument ....... Argument ....... Beginning of window ....... Regex replace ....... Change modified ....... Backward paragraph ....... Forward paragraph ....... Delete horizontal space ....... End of window ....... Find delimiter ....... Goto beginning ....... Backward kill level ....... Next window ....... Previous window ....... Shrink window ....... Enlarge window ....... Show menu ....... Grep ....... Goto end ....... Help ....... Indent for comment ....... Query replace ....... Insert ascii
horizontally
s sc sh s! s" s s s
95
96
interactively
t[, t[,
interactively
97
t[, t[, t[, t[, t[, t[, t[,F t[,! t[, t[, t[, t[, t[,E t[,G t[,H t[,I t[,J t[,L t[,M t[,N t[,O t[,P
.. Start kbd macro .. Goto tag .. Kill window .. One window .. Split window .. Split window vertically .. Compare windows .. Next buffer .. Pluck tag .. Previous buffer .. Rectangle mode .. Set comment column .. Select buffer .. Dired .. Last kbd macro .. Set fill column .. Goto line .. Insert file .. Jump to named bookmark .. Kill buffer .. Count lines .. Make
t[,Q .. Next window t[,R .. Next window t[,S .. Previous window t[,U .. Redo t[,V .. Save all buffers t[,X .. Undo t[,Z .. Write region t[,[ .. Copy to scratch t[,\ .. Insert scratch t[,] .. Zoom window t[,s .. tag files t[,s .. Select tag file t[,sL .. Untabify region t[,sQ .. Name kbd macro t[,t> .. Alt prefix t[,tA .. Ctrl prefix t[,tE .. Bufed t[,tF .. Exit t[,tG .. Kill window t[,tH .. Push t[,tI .. Find file t[,tK .. Highlight region t[,tL .. Indent rigidly t[,tP .. Start process t[,tQ .. Next position
98
t[,tZ Write file t[,t[ Exchange point and mark t[,t] Exit level t[,tsA Ctrl prefix t[,tsL Tabify region
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Your selection of which interface to use will control the operation of all of the items on the Version Control submenu of the Tools menu, and version control related buttons on any toolbars. The capabilities that Codewright provides will vary somewhat depending on which of these interfaces you use. You select which you plan to use by selecting Setup from the Version Control submenu on the Tools menu.
The last item, the interface DLL, must be developed specifically for the providers system. Whether it is done by Premia, the provider, or as a collaborative effort may determine where you can obtain this DLL. It may come on your providers disks, on your Codewright disks, or may be downloaded from an online service or BBS. As of this writing, interface DLLs are only available for Intersolvs PVCS and Microsofts Visual SourceSafe. Any system that is designed to be used with Microsofts published version control interface for Visual C++ may be readily adapted to work with Codewright, however.
114
Unlisted Providers
If you do not see you provider listed, you will need to create your own command lines. If you know that one of the command sets listed is similar to yours, you may want to select that one, and use its commands as a starting point for your own. To start from scratch, select Other from the list. In either case, you will need to pay a visit to the Project Properties dialog to define or modify the command lines. Select the Tools tab, and you will see a list of command lines. Scroll toward the end of the list, and you will see seven External VCS commands that you can define or customize.
Check In Command
The Check-in command is the command line needed to check in a file to your version control system or archive. If possible, this command should work whether an archive currently exists for the workfile or if one must be created. If the check-in command is empty the following command will be used: put %b%e The initial check-in command defined in your CWRIGHT.INI file is as follows: put -t@%Q -m@%Q %b%e The additional flags and %Q macro enables you to supply a description of the changes or of the archive itself, when creating a new archive, to the check-in command. This is done
115
116
Lock Command
This is the command that your version control system uses to lock a revision without checking it out. This is useful when you already have a modified version of the source file that you want to check in, but you discover that the file was not locked. Note Make sure that your modified version contains all the changes in the most recent revisions before doing this. If it does not, use a merge utility (such as Codewrights) to merge your changes with the ones you are missing before you check it in.
Unlock Command
This is the command your version control system uses to unlock a revision without checking it in. It is useful when you discover that you have a file checked out that you do not plan to modify at present.
Log Command
This is a command to obtain a report about activity in the current documents archive. You may make it general or specific whichever best meets your needs. It can be anything from list all changes and their descriptions to what is the number of the latest revision?
Manager Command
This is the command that brings up you version control packages manager, if any. The manager is a general purpose, menu or form driven program that lets you perform a variety of version control functions. It is useful when you have a slightly unusual need that is not covered by the other version control commands.
117
118
What is a Project?
A project, at a minimum, is a list of files that you find it useful to group together logically. Creating a project facilitates operating on these file as a group, whether you are using version control, creating a "Tags" database, or even if you are just loading files. The project may be further divided into Workspaces, which may contain project and nonproject files. A project may also store the options you have selected. If you wish, your project files may contain almost as much information as your Codewright configuration file.
What is a Workspace?
You can think of each workspace almost as a separate instance of Codewright. That is, when you change workspaces you have the ability to pick up where you left off with a group of files. It doesn't matter if you worked on that group of files a half hour before or three months ago. It is as if an instance of Codewright were frozen in time containing these files. A workspace differs from a project in that it does not store the system-wide options normally stored in a configuration file. In a sense, the workspace is like a state file that you can swap on the fly. As such, it retains information about the currently open windows and buffers. Other state information such as search options, response histories, bookmarks and so on are stored as part of the project.
119
120
Using Projects
You specify the members of a project by selecting the Files tab of the Project Properties dialog. Locate the files you want to add by navigating your file system as you would when using the File Open dialog. You may select a series of files and then add them by pressing the Add button, or you can double click on each filename to add it to the project. A file may be a member of more than one project, so specify any files you want to group together logically and which you might want to operate on as a group. Files that are included in the project are listed in the box at the bottom of the dialog as you add them. You may delete files from the project by selecting them in this box and then pressing the Delete button.
Next select the Tools tab: Project Command Lines Define the major project-wide command lines you will be using (other than the command to compile the current file). For example, your Make command might be Ftee nmake -f %y.mak. (%y indicates the path and root of your project file) If you already have a makefile, just name it explicitly instead of using %y. If you will be using VDOS instead of FTEE to watch the progress of the command, just omit FTEE from the command.
Finally, select Compile from the list of tools, and then press the Compiler button that appears in place of the Browse button. Compiler Command Lines The compiler to use is associated with the extension instead of being associated directly with the project. Compiler associations are project specific, by default, so make sure the right associations are in effect.
Using Projects
This section describes the uses you can make of projects, once defined. The primary uses of projects covered here are listed below:
121
Using Projects
Selecting or Changing Projects Loading Files for Editing Creating and Selecting Workspaces Searching Project Files Selecting files for Check-in or Check-out Generating a compiled tags database Making different build parameters for different purposes
Project Window
Alternately, you may wish to use the Project Window to operate on files in a project. As with the Load Files dialog, you just select the desired files from the list and press ( to load the files. It has the advantage, however, of showing which files are actually on disk (some may currently be archived), and whether they are read/write. In addition, you may define filters (file specification patterns) to sort the file list into groups.
122
Using Projects
The primary purpose of the Project Window is to facilitate version control operations. For this reason, you will find that by right clicking on a file or one of a selected group of files will bring up a menu with a list of available version control operations.
Creating a Workspace
One of the most powerful aspects of projects is the workspace. At any time while working on a project, you can select Save Workspace from the Project menu and create a new workspace. Just give your workspace a name -- a descriptive name this time, rather than just a file name -- and you are done. A workspace name may contain any printable characters (including spaces) except apostrophe ( ' ), backslash ( \ ), quote ( " ), and square brackets ( [ ] ). Suppose that you have a number of files open, and want to create a new workspace that doesn't include any of the files currently open. Select Load Workspace from the Project menu. You will see listed there a workspace that is always available, called <none>. You can select that workspace to wipe the slate clean. If the "Delete buffers and windows" option is set to "All", your buffers and windows are all closed so that you can start afresh. Of course, if any of the buffers contain changes that have not been saved to disk you will be given an opportunity to do so. Now that you have your clean slate, open the files that you want to have open in your workspace. Anytime you are ready, you can save your workspace under whatever descriptive name you wish. Remember that workspaces are specific to the projects in which they are created. You could have an "options dialog" workspace in several different projects, but as far as Codewright is concerned, they are unrelated.
Workspace Saving
You may at any time save a workspace by selecting Save Workspace from the Project menu, but this is usually only necessary when creating a new workspace. Codewright automatically updates the active workspace whenever you: close or change projects, exit Codewright, and optionally when you change workspaces.
123
Using Projects
Changing Workspaces
Once you have created more than one workspace, you will find it easy to switch between them. When you select Load Workspace from the Project menu to do this, you will notice a couple of options are available. These options relate to what happens to the workspace you are leaving.
Update Current Workspace When the Update Current Workspace box is checked, the workspace you are leaving is automatically updated before the new workspace is loaded. Close Windows/Delete Buffers You may choose to close all windows and buffers after leaving one workspace and before the next is loaded. In this event, no buffers or windows are carried over from one workspace to the next. You may elect to just close the files that are members of the workspace. This means that any files you opened during the session, such as a special header file, will carry over to the next workspace. You may even choose to have all files carry over into the next workspace. If you do this, we recommend that you either delete the carry-over buffers before saving the workspace, or save the workspace under a new name. Otherwise, workspaces will become less distinct, and therefore less useful, entities.
Keep in mind that the saving of windows and buffers in the workspace you are leaving is unaffected by which of these options you select.
124
Project Files
A project file is essentially a configuration file and state file all in one. Workspaces are stored as additional "state files" within the project file. Once you understand the format of a Codewright configuration file, you understand a Codewright project file. These files look just like standard Windows .INI files with headings enclosed in square brackets, and statements on lines following these headings. Statements take the form of <keyword>=<value>. The primary difference between a Codewright configuration or project file and a Windows .INI file, is that keywords may not be repeated within a section of a Windows .INI file. In a Codewright configuration or project file, keywords may be repeated. This is possible because Codewright processes these files directly, without going though Windows. For more information on the format of configuration and related files, refer to the "Configuration and State" chapter of this manual.
125
126
Regular Expressions
Regular Expressions are a powerful notation for describing string matching patterns that has gained wide acceptance. Codewright Professional optionally makes available Unixstyle Regular Expressions for use in searching. They have now gained wide acceptance outside the Unix realm. The relatively small investment of time required to gain a useful knowledge of Regular Expressions can pay you back many times over. As you begin using Regular Expressions, keep an eye out for new uses. This will help your use and understanding of Regular Expressions to grow, as well as save you time. A Regular Expression can be as simple as a single literal character. Such simple expressions are usually a subexpression of a more complex regular expression. In reading the descriptions that follow, an "expression" may mean a single character, a group or class of characters. These topics are described in detail in this section of the manual.
Special Characters
Regular Expressions give special meaning to certain characters. Some are operators and some show grouping. There is also a method of representing non-printing characters, such as a tab, within Regular Expressions. All other characters just represent themselves, as they would in an ordinary string search. The characters to which Regular Expressions give special meaning are called metacharacters. These characters and their meaning are shown below:
127
Escape Sequences
Character . *
+ ? [ and ] ( and )
| $ ^ \ \c
Meaning Matches any single character, except a newline Matches any number of occurrences (even zero) of the expression that precedes it. Matches one or more occurrences of the preceding expression. Matches zero or one occurrence of the preceding expression. Defines the beginning and end of a character class. Defines the beginning and end of a group of expressions. Groups expressions into a larger units, dictates precedence. Each group is also a Reference Group which may be pasted into a replacement string. Alternation. Allows matching the expression on the left or on the right of the operator. Matches the end of a line. Two meanings: Matches the beginning of a line. Complement operator when the first character in a character class. Used for escaping metacharacters and non-printing characters. The position in the pattern at which the cursor is placed at the end of a successful search.
Escape Sequences
There are times that you want to use a metacharacter as itself -- without the special meaning that Regular Expressions gives it. For example, you may wish to match a dollar sign, rather than look for the end of a line. To match a dollar sign you must escape or quote it. This is done by preceding the character with a backslash. This is true of all the metacharacters. To match a dollar sign, for example, you use \$ in your Regular Expression, rather than just $. Below is a list of other escape sequences supported by Codewright Professional's Regular Expressions:
128
Character Classes
Escape \n
\t \b \r \f \nnn \xnn \m
Meaning Newline (<CR><LF> or <LF>, depending on how it is defined for the document) Tab Ctrl-H (backspace) Carriage return form feed Octal value between 0 and 0377. Hexadecimal digit between 0x00 and 0xFF The literal character m.
Matching a Character
The basic unit of a regular expression is matching a single character. You can match a single character in one of three ways: Literally, Ambiguously, or with a Character Class.
You may match a character literally by using the character itself or the appropriate escape sequence. If matching a character literally is too limiting, you may match ambiguously, by using the dot ( . ) metacharacter. If a literal character is too narrow a match and the dot is too broad a match, a character class can be used for anything in between.
Character Classes
A character class is a series of characters enclosed in square brackets. It specifies a set of characters, any one of which may match. For example, the character class [AEIOUYaeiouy] matches any vowel, whether upper or lower case. Ranges of characters may also be specified within a character class. This is done by placing a dash between the character that begins the range and the character that ends the range. The following character class
129
Iteration Qualifiers
[0-9] will match any character between 0 and 9. How do you match a dash, then? If it is not in the character range you specified, just place it at the beginning or end of the character class where it is not between two characters of the class. If you precede the dash with a backslash ( \ ) you can put it anywhere within the class. The caret ( ^ ) has a special meaning when it appears as the first character of a character class. It complements the class. When it appears at any other position within the character class, it just adds the up-caret to that class. You may use it as a shorthand method of saying "match any characters except for the following:", rather than specifying a large character class. For example, [^$.|(){}*+?^] matches anything except the eleven characters following the up-caret.
Iteration Qualifiers
Iteration qualifiers are metacharacters that are not regular expressions by themselves. Instead, they state how many iterations of the preceding expression there must be or can be, in order to match. These metacharacters are: *, + and ?. As stated in the table above, the * matches any number of occurrences, the + matches one or more, and the ? matches
130
131
132
133
Examples
When using Codewright Professional's regular expressions, you have a special escape sequence available that allows you to indicate where in the matching text the cursor should be positioned. You should note that this is available only for search operations. It is not for use in replacement text. The escape sequence that specifies cursor position is \c. An example of its use follows: singletons\[\c.*\] This example places the cursor at the beginning of whatever text is contained between the left and right square brackets. The square brackets are metacharacters and are therefore escaped. This cursor positioning facilitates editing the contents of the square brackets.
134
Examples
Examples
The following examples are intended to inspire your own uses of regular expressions:
Pattern
[A-Za-z_][A-Za-z0-9_]* -?([0-9]+\.?[0-9]*|\.[0-9]+) ([ \t]|^)[^ \t]+ [^ \t]+\c([ \t]|$) ([^A-Za-z0-9]|^)[A-Za-z0-9]+ [A-Za-z0-9]+\c([^A-Za-z0-9]|$) /\*.*\*/ /\*.*\n([ \t]*\*.*\n)*.*\*/
Description C language identifier Floating point (real) number Beginning of word (simple whitespace) End of word (simple whitespace) Beginning of word (Non-alphanumeric) End of word (Non-alphanumeric) Single-line comment (C language) Multi-line comment (C language)
135
General Operation
This chapter presents Codewright Professional topics that you may need to consult on a reference basis from time to time. The topics are presented in alphabetical order, for added convenience.
136
Control %b
%d
Represents basename
directory
%[{...}]e
extension
%f %p %[{...}]r
%v %%
volume percent
Description The entire name of the output file (fully qualified), less the extension. (e.g., C:\SRC\FOO) Includes the path, less the drive (volume) specifier and filename, but ends with a backslash only if describing the root directory. (e.g., \SRC) Includes the dot that separates the basename from the extension, unless the name of the output file has no extension. May optionally contain a transformation pattern, as described below. (e.g., .BAR if no transformation pattern supplied) The root name and extension. Does not include the drive (volume) or filename. Always ends with a backslash. (e.g., \SRC\) Does not include extension, drive (volume) or path. May contain an optional transformation pattern, as described below. (e.g., FOO if no transformation pattern supplied) The drive letter and the colon. (e.g., C:) A single percent sign is represented by two consecutive percent signs (%%).
As an example, the formatting string which represents the initial default is "%b.BAK". You would set this default using a function call like the one below: BufSetGlobalBackupSpec="%b.BAK"
137
A single vertical bar ( | ) separates the override pattern from the fill pattern. If you are supplying only the override pattern, you may omit the vertical bar. Supplying only the fill pattern is pointless, since the resulting string will be empty. The rules are the same for using transformation patterns, whether you are using them on the root of a filename or its extension. There is one noteworthy difference in their result, however. After the transformation is performed on an extension, the resulting extension is examined. If the extension is not null, a dot is added to the beginning of the extension. This is true whether or not the original extension was null.
Override Pattern There is a character in the override pattern for each character in the resulting string. The character at each position may be either a valid filename character, or a question mark ( ? ). If a filename character ivs specified, the character in the original string is replaced by that character. If a question mark appears at a given position in the string, the character in the original string is used. If no character appears in the override pattern for a given position (i.e., the root is shorter than 8 characters or the extension is shorter than 3), the resulting string is truncated at that position, even if a you have supplied a fill pattern. Fill Pattern The fill pattern may contain only valid filename characters. The character at a given position in the pattern is used in the resulting string if that position in the original string is empty (i.e., the original string is shorter than the fill pattern) and a question mark is specified by the override pattern.
138
Command Key
Illustrative Examples
The following illustration shows how the characters in the override pattern take precedence over those in the original extension, and how the fill pattern characters become the default:
The following examples demonstrate the effects of various override and fill patterns:
Pattern
%r%{??~|___}e
Original Name
foo.cpp foo.c
Backup Name
foo.cp~ foo.c_~ foo.cp~ foo.c foo.~pp foo.~ foo.~ foo.~ foo.c foo.c foo~~~~~ foo~~~~~.c testfil~.c foo.bak foo.cak testf.cak
%r%{??~}e
foo.cpp foo.c
%r%{~??}e
foo.cpp foo.c
%r%{~}e
foo.cpp foo.c
%r%{?}e
foo.cpp foo.c
%{???????~|~~~~~~~~}r%e
%{?????}r%{???|bak}e
Command Key
The Command Key is a keystroke that calls the LibFunctionExec function. It provides an interface to Codewright's API while you are running Codewright.
139
Command Key
If you find you want to do something in Codewright for which there is neither a key command nor a menu entry, you can probably do it using the Command Key. If you are using the CUA and vi command set, the Command Key is . If you are using the BRIEF-compatible command set, the Command Key is , which in BRIEF provides access to the BRIEF interpreter. In keymaps where there is no such assignment, you can still execute an API Command by selecting API Command from the Tools menu. When you press the Command Key, a prompt appears on the status line or in a pop-up dialog box, depending on which is enabled: Command: You then respond by entering a Codewright API function call, much as you would enter it in Codewright's C source code. Pressing ( sends the command off for processing.
Command Completion
In addition to the command history, described in the previous section, you can also use the command completion feature. This feature is only available when status line prompting is in effect, rather than the pop-up dialog. You can control which type of prompting is used through the System tab of the Environment dialog found on the Tools menu.
Figure 3: Command Completion list after entering "color" Command completion allows you to enter as much of a command (function name) you can recall and then press the 7 key. In return, you receive a list of commands that begin the same way as your partial command. You can then select the desired command
140
Command Key
from that list and it is placed on the prompt line for you. If you want a complete list of the commands available just press the tab key without entering anything at the prompt.
141
Command Key
User written functions are available only when registered. The function LibExport must be used to register a user function, its parameters and return value before it may be called from the Command Key. Parameters may be omitted. If you omit parameters from a function call issued through the Command Key, Codewright will either fill in default values or the call will fail. In source code, you have no option but to supply parameters, if you want it to compile. The format permitted and required varies from that of source code. The requirements on quoting string constants are stringent so that other requirements may be more lax. Spaces can be used to separate function parameters in place of commas, and spaces, equal signs, or parentheses may be used to separate a function name from its parameters.
Examples of Usage
BufSetHexBinary BufSetHexBinary() bufsethexbinary All three of these examples do the same thing. They put Codewright in the Hex Editing mode, with the cursor located in the "binary" portion of the display. MovNextChar( 2 ) Movnextchar 2
142
Command Key
Both of these examples advance the cursor position by two characters. BufEdit( "c:\projecta\debug.c" ) bufEdit "c:\projecta\debug.c" Either of these commands opens a document for C:\PROJECTA\DEBUG.C. kmapAssign( "<ctrl-a>", "BufSetHexAscii" ) Assigns the function BufSetHexAscii to the keystroke Ctrl-A. MarkBeginSel( SELECTION_INCLUSIVE ) Begins an inclusive selection, using one of the labels listed in the Online Programmer's Reference.
Expression Evaluator
The Command Key provides another capability that you may find useful in programming, debugging, or just in place of a calculator. Codewright can evaluate a numeric expression that uses C language operators and grouping, and display the result. You signify that your response to the Command: prompt is an expression you wish to evaluate by preceding the expression with two question marks. You can use Codewright identifiers in these expressions. Here are examples of an expression to be evaluated: ??SELECTION_INCLUSIVE ??0xcf54-3*4 ??MARK_GLOBAL+1 The following operators are supported in expressions, grouped by precedence, and listed in order of decreasing precedence:
143
Line Drawing
Operator
( ~ ! / * % + << >> > < <= >= == != & ^ | && || )
Operation
Grouping Unary Minus Bitwise Complement Logical NOT Division Multiplication Modulus Subtraction Addition Bitwise Shift Left Bitwise Shift Right Greater Than Less Than Less Than or Equal Greater Than or Equal Equivalence Non-Equivalence Bitwise AND Bitwise Exclusive OR Bitwise OR Logical AND Logical OR
Line Drawing
A line drawing package is supplied with Codewright Professional that allows you to draw boxes, lines and simple charts, using the IBM Extended Character Set. If you or a subsequent viewer are using a font other than one of the "OEM" or terminal fonts, the lines and boxes drawn with this package will look like garbage. To use this package, a Dynamic Link Library named CWLDRAW.DLL must be loaded. Look in your Codewright Professional configuration file, usually CWRIGHT.INI, and find a line like the one below in your [LibPreload] section: LibPreLoad=CWLDRAW.DLL In your file, the line may be preceded by a semicolon, which disables the use of the DLL by commenting it out. If so, remove the semicolon so that the line drawing package will
144
Line Drawing
be available the next time you start Codewright Professional. If your configuration file does not have a line like the one depicted above, place this line in the file. The line drawing package uses the arrow keys on the cursor pad to draw lines when the ) and + keys are also depressed. There is another entry you can place in your configuration file to make the necessary key bindings to do this. Put the command below on the line following the line that loads CWLDRAW.DLL: SetLineDrawBindings= Here are the key assignments installed by this command:
Move up and insert appropriate character. Move down and insert appropriate character. Move left and insert appropriate character. Move right and insert appropriate character.
The "appropriate character" is determined by whether you are drawing a straight line, turning a corner, or intersecting with another line. It also depends on which line drawing style you select. The example below demonstrates the styles available:
Use the function SetLineDrawStyle in your configuration file, or through the API Command Key to set which style the line draw package will use. The default style is Style 1. You can use the same command, regardless of which method you are using to set the style. From the API Command Key, it would look something like this: Command: SetLineDrawStyle=4 This sets the line drawing style to 4. You will probably find that Overtype mode is best for adding labels to boxes and charts.
145
Menu Editor
Menu Editor
The Menu Editor allows you to change, delete and add menus and menu items interactively. It is located on the Menu tab of the Environment dialog on the Tools menu. (At least, before you use the Menu Editor that is where it is.
Menus
Menus are the top-most selections on the Menu bar. They contain items and submenus. You begin your modification of the menu by selecting a menu from the list on the left. Up/Down These buttons allow you to change the position of the menu relative to other menus. Up and down refer to the position in the listbox. Up moves the selected menu to the left on the menu bar, while Down moves the menu to the right. Add Menu The Add Menu dialog lets you add a menu to Codewright's menu bar. You must provide a name for the menu, a unique ID number, a helpful message to display when the menu is selected, and, optionally, one or more functions to initialize the menu. The initialization functions are responsible for disabling or check marking menu items as necessary.
146
Menu Editor
Change Menu Attributes The Change Menu Attributes dialog is like the Add Menu dialog, except that the attributes for the selected menu are displayed for editing. You cannot change the ID of a menu. Delete The Delete button deletes the selected menu. You could delete all menus, if you wish. You would then find that you are unable to add them back interactively, once you leave this dialog. (You couldn't get the dialog back.) If the worst happens, you can restore the original menu by editing Codewright's configuration file, CWRIGHT.INI. Locate the [Menu] section of the file and rename the section, or delete all lines under that section heading.
147
Prompt Histories
Add List There are five lists which may be added to the bottom of a menu: recent files, scrap buffers, edit buffers, recent projects, and windows. If you are using One-document-per-window mode, the list of edit buffers is not available. (See System tab on the Environment dialog) Each of these lists may only appear on one menu. Therefore, you must first delete a list from a menu before you can add it to another. This button is disabled if there are no unassigned lists.
Operating on Submenus
To view or operate on a submenu, you must double click with the mouse on the submenu (marked with a plus) in the list on the right. The submenu then moves to the list on the left and is marked with a minus sign. You may then operate on it as you would a menu, adding items, moving and deleting items as you desire. Whenever you are through operating on a submenu, you may move it back to the list on the right by double clicking on the name again. The minus sign will change back to a plus when it arrives in the list on the right. This system allows you to have any level of nesting of submenus that you like. Just keep adding them on the right and moving them over to the left.
Prompt Histories
Many of Codewright's prompts remember previous responses you have made at that prompt. Most notably, the Command Key prompt, the Search and Replace prompts, and the prompt at which you enter the name of a file to edit have prompt histories.
Status Line When the prompt appears on the status line, the prompt history may be activated by pressing either the up arrow or the down arrow. Pressing the up arrow reuses the most recently entered response, whereas pressing the down arrow reuses the oldest. Repeatedly pressing the up arrow allows you to view earlier responses. Repeatedly pressing the down arrow key views more recent responses. Pressing ( accepts the response displayed.
As each historical response is displayed, you will note that it is highlighted. If you issue , , or , the highlighting disappears and an editing command, such as you are permitted to continue editing the response. You can accept the edited response at anytime by pressing (. If, when the response is still highlighted, you type characters, the typing replaces the highlighted text. This allows you to easily type in a new response, if the one you are looking for isn't in the history.
148
Prompt Histories
Dialog Boxes In dialog boxes, a "combo" box is used to present prompt history. Pressing the down arrow button to the right of the edit box will cause a list box to drop down, containing previous responses to the prompt. Select one, and you are ready to edit or execute the command.
There is a history editor on the History tab of the Environment dialog on the Tools menu. It allows you to view and remove members of these prompt histories. Many prompt histories are saved between Codewright sessions by default. This information is saved in the State file. For more information about Codewright State files, refer to the "Configuration and State" chapter of this manual.
149
The command line flag, or the environment variable will have an associated string value, when it is used to point to the configuration file. This string names the directory in which the configuration file resides. It may also name the file itself. For example, the string may take this form when specifying a directory: d:\source\project1 It may also take this form when specifying a file: d:\source\projects\cencom.cfg If Codewright does not find a configuration file at all, it will create one in the working directory, when it needs one. Codewright has no problem running without a configuration file, but it does notify you if one could not be found.
150
Configuration File
The configuration file normally contains information about the way you have Codewright set up. This information may be put there during installation, through modifying the settings in dialog boxes, or by directly editing the configuration file. In the latter case, the configuration file might contain almost any Codewright commands. The configuration file is nominally CWRIGHT.INI. The configuration file is a text file that follows the same general format as other Windows .INI files. It contains section headings enclosed in square brackets followed by configuration statements. Headings that appear in a Codewright configuration file include: [Editor], [LibPreload], [Colors], [DefaultKeymap], [KmapAssign], [Printer], [Compiler], [VersionControl], [Definitions] and [Fmatch]. The configuration statements contain keywords with string assignments. For the lines containing keywords, the format is as follows: <function>=<param 1>[,<param 2>,...<param n>] The keywords are actually the names of functions in the Codewright API. The string assigned to the keyword contains the parameters required by that function. The assigned string may contain whitespace. The parameters may be numbers, strings, constant identifiers and operators. Variables and nested function calls may not be used as parameters.
State File
The State file contains information about the buffers and windows you had open when last you exited Codewright. It also contains the more transient information about your Codewright settings, such as your search options and responses to prompts. It follows the same rules as a configuration file, but it is normally limited to one section named [State]. This file is nominally CWRIGHT.PST.
151
Example File
Here is an abbreviated example of a configuration file:
[DefaultKeymap] DefaultKeymap=brief [KmapAssign] KmapAssign=<Ctrl-`>, Preprocess [LibPreload] LibPreload=PRG.DLL [Editor] KeyDelay=1200 KeyRepeat=5 Autosave=20 SysSetFileLocking=30 [Colors] ColorError=0xe0 ColorWarning=0xd4 SysSetDefault=DEFAULT_COLOR_TEXT,0x1f SysSetDefault=DEFAULT_COLOR_SELECTION,0x9e [Printer] PrintLineInc=5 PrintFooter="-Page %p-" PrintHeader="%f %d %t" PrintFlags=145
152
Example Interpretation
Here is an interpretation of the contents of the example configuration file above. The analysis proceeds section by section:
Editor Section The Editor section of the example configuration file sets the keyboard delay and repeat rate. Auto-save is set to occur after 20 seconds of keyboard inactivity. File locking is enabled for 30 file handles Colors Section The Colors section of the example sets the color of error messages to black on yellow, and the color of warning messages is set to red on gray. These are global settings. The next two color settings may be set differently for each edit window. For this reason, we do not use the functions ColorText and ColorSelection to set the colors, but rather set what the default color will be. You use the SysSetDefault functions when setting defaults for things that are specific to individual buffers or windows. In this case, the color of text is set to white on blue, and the highlight for the selection is set to yellow on light blue. DefaultKeymap Section The default key command set to BRIEF. This will cause BRIEF.DLL to be loaded and its function brief to be called. KmapAssign Section In the KmapAssign section, a key assignment is added to the default keymap. The Preprocess function is assigned to the Control - Backquote keystroke. LibPreload One of the supplemental language support DLLs is loaded for use.
153
Processing At Startup
Printer Section The Printer section and a number of other sections use private, undocumented functions. The Print menu item within Codewright controls the contents of this section. You can probably guess what most of it does, but you are not encouraged to fiddle with it. Definitions Section This section defines the label DEBUG and gives it a value of one. This label may be used in numeric expressions processed by Codewright, including those given through the Command Key and the Preprocess function (#ifdefs). Compiler Section In this section, the Borland C++ compiler is assigned for use on files that have the .C file extension.
Processing At Startup
When Codewright is launched, the command line is processed before the configuration file or the state file. This gives the command line the opportunity to specify the location of these files. It also means there is some potential for the configuration file to reverse the effects of a parameter specified on the command line. The following sections of the configuration file are automatically read at startup in the order given: Menu DefaultKeymap KmapAssign LibPreload Editor VersionControl Template Colors Ribbon
After the portions of the configuration file that are automatically read have been processed, the state file is processed. This gives settings in the state file priority over similar commands in the configuration file.
154
Processing At Startup
Order of Processing
The functions under each of the section headings are executed in the order they are listed. Regardless of the order in which the sections occur, however, the sections are always executed in the same order. The Printer, Compiler, Definitions and other sections are processed as needed. Each section heading represents a logical grouping of functions, as shown in the list below:
+HDGLQJ
Colors
)XQFWLRQV
Functions to set the colors for text, messages and so on. This is done with the SysSetDefault function described in the Online Programmer's Reference. Used primarily by Codewright for saving associations between file extensions and compilers. The function that sets the initial key command set, usually Brief or CUA. For example, the statement DefaultKeymap=brief will cause Codewright to load BRIEF.DLL and call its keymap function, which it assumes to be the same as the filename root -- brief. Defines labels for use in expression evaluation. System-wide functions, default settings (except for keymap), and any other functions that are not order dependent. Used by Codewright for saving the parameters used by the File Find and File Grep features. Key assignments that are additions or modifications to the default keymap. Load DLLs that are not automatically loaded. Defines the menu structure, if other than the default. The results of using the Menu Editor are placed here. Used by Codewright for defining print margins and headers. Defines modifications to the default ribbon and sidebar configuration after using the ribbon editor. Contains user-defined Language Template definitions. For defining command lines for Check-in, Check-out and several other related commands. The section is duplicated for each version control system defined, so that you may have separate commands for each.
Compiler DefaultKeymap
Definitions Editor Fmatch KmapAssign LibPreload Menu Printer Ribbon Template VersionControl
You may place any Codewright function under any of the section headings, but grouping functions logically under section headings will help ensure that the functions are executed
155
Save and Restore Position The following example can be used in place of the standard save and restore position commands:
[RotateMarks]
156
Scrap Buffers This next example makes good use of Codewright's Multiple scrap buffers. For it to be useful, you must first define more than one scrap buffer. You define the number of scrap buffers in the Clipboard tab of the Document Preferences dialog. Use these sections instead of Cut, Copy and Paste:
[RingCopy] BlockCopy= ScrapNext= MsgMessage="Copied to current scrap" [RingCut] BlockCut= ScrapNext= MsgMessage="Cut to current scrap" [RingPaste] ScrapPrev= BufInsertScrap= MsgMessage="Current scrap inserted" When using these three sections in place of Copy Cut and Paste, you get a last-in first-out ring of scrap buffers. Successive copy or cut operations (without an intervening Paste) do not overwrite each other until you run out of scrap buffers. Successive Paste operations let you paste the contents of each scrap buffer in the reverse order they were used.
157
Checkbox Option Buffer Defaults Window Defaults Default Window Font Default Window Colors System Colors
System Options
Language Options
Related Configuration Function SysSetDefault=DEFAULT_BUFFER SysSetDefault=DEFAULT_WINDOW _FontDefault SysSetDefault=DEFAULT_COLOR ColorCommandLine ColorError ColorMessage ColorWarning BufSetGlobalBackupSpec ExtCommentSearchLimit ExtDelayedColoring KeyDelay KeyRepeat Autosave AutosaveDir BrowseSetFile CompilerAddBuild CompilerAssign CompilerNewExt TagSetFileCompilerAdd ExtColors ExtColorsAssoc ExtIndentEnable ExtIndentEnableAssoc CheckInSetCmd CheckOutSetCmd FilterAdd FilterDeleteList ClipboardEnableSepStr ClipboardEnableTermStr ClipboardSetSepStr ClipboardSetTermStr ScrapSetCount StateSetMarkLevel
158
State File
State File
At your option, Codewright's condition at the time you exit may be recorded in a file. As part of the installation process, you had the opportunity to turn this feature on or off. If you elected the default setting, saving the state was turned on. You may specify the location and name of your state file in your Codewright configuration file. If you name a location for your state file by accessing a dialog box through the menu, it will be saved in your configuration file. If your configuration file does not contain the name of your state file, and saving state information is turned on, Codewright will search for the location of the state file in much the same manner used to locate the configuration file. The differences are as follows: The command line flag for specifying the state file is /S. The environment variable that points to the state file is CWPST. Instead of looking for CWRIGHT.INI, however, it will be looking for CWRIGHT.PST.
Once again, if no location is dictated for the state file, and no existing file is found, the file is created in the working directory. Codewright can operate just fine without a state file. In fact, you may turn off the saving of state information, and Codewright will ignore any state file and the information it contains. Similar to the configuration file, the strings that give the location of the state file may also dictate a name for the file. If the string names only a directory, the name CWRIGHT.PST will be used. The following methods of setting the location of the state file are all valid: Using the environment variable -set CWPST=d:\premia On the command line -cw /sd:\premia\cwright.pst In the CWRIGHT.INI file -StateSetFilename=H:\home\ericj
159
State File
Windows Visible attributes Colors Coordinates and extents System flags Attached buffer, if any Default Window Properties for the above Buffers File name Output file name Tab settings Backup file specification Line and column Max. virtual lines Current mode (hex, compact, normal) System flags Default Buffer Properties for all of the above Prompt Histories Search and Replace Command Key Open file Miscellaneous Search flags Codewright's Window frame coordinates and extents
160
Filenames
You may specify any number of files to edit on the command line, limited only by the command line length. You may use wildcards to specify multiple files. These files are loaded in addition to, rather than in place of, any named in the state file.
Flags
Consider whether you wish to allow the configuration file to be read before or after each flag that you specify. The configuration file may in some cases cause a command line flag to be ineffective if the flag is processed first. There are upper case and lower case
161
Flags
versions of each of the Command line flags, where ever applicable. Flags specified with a lower case character will be processed before the configuration file is read. Flags that use an upper case character will be processed after the configuration file is read. Some flags require additional information in the form of an argument. The arguments appear in italics following the flag, in the descriptions below. When supplying an argument to a flag, Codewright permits the argument to immediately follow the flag, with no intervening whitespace, or to be separated from the flag by whitespace. The flags listed below are depicted as preceded with a minus or dash character ( - ). While a slash will also work in most instances, these can be mistaken for filename paths and should be avoided. -C<configLoc> The configuration location flag allows you to specify the directory or file in which configuration information is to be found. The configLoc argument names that directory or file. If configLoc names only a directory, Codewright looks for a file named CWRIGHT.INI in that directory from which configuration is read. If it names a complete path, including filename, Codewright will attempt to read configuration information from that file. When this flag does not appear on the command line, Codewright looks for a configuration information in a series of places. These places include: a directory or file named by the CWRIGHTINI environment variable, in CWRIGHT.INI in the Working Directory, in CWRIGHT.INI in the directory in which the CW.EXE or CW32.EXE file is located, or in CWRIGHT.INI in the windows directory.
This default search for configuration information is described in greater detail in the "Configuration and State" chapter of this manual. Example: cw -c c:\source\proj1 -CThis is a variant of the configuration location flag that instructs Codewright not to read a configuration file.
162
Flags
Example: cw -c-G <lineNumber> Go to the line number indicated by the argument. It should follow the name of the file to which it refers, and it may be specified following each file named on the command line. This flag will be overridden if you attempt to position the cursor in a file loaded as part of the state restoration. Example: cw -g215 -heapalloc The heap allocation flag may be used for user debugging purposes. THIS OPTION IS ONLY AVAILABLE ON THE 32 BIT VERSION OF CODEWRIGHT. When used, Codewright will use global allocation of memory. This makes it easier to detect allocation errors. Use this if you suspect your DLL has this type of memory error. Example: cw -heapalloc -K <keymap> The keymap flag names a default keymap to be used by Codewright. If this flag is used, the [DefaultKeymap] section of the Codewright configuration file will not be read. The keymap argument to this flag names a DLL (less the .DLL extension) containing the default keymap. The argument at the same time names the function contained in the DLL which initializes the keymap and makes the key assignments. Example: cw -k mycua -L <library> The library flag designates a dynamically linked library to be loaded at startup time. This flag is useful for testing user created or modified DLLs before a more permanent
163
Flags
installation. It can, however, significantly increase the amount of time it takes Codewright to start up. The library argument is the name of the library to be loaded. If this argument does not name a path to the DLL, Codewright will look in the current directory, the Windows directory and on the PATH, in an attempt to locate the DLL. Example: cw -Lmyutils -M The multi-instance flag allows you to run more than one instance of Codewright at a time. By default, multiple instances are disallowed. Your operating system must be either Windows 95 or Windows NT for this option to work. Example: cw -M -N The no files flag indicates that the state file is to be processed, except that no files from the previous session are to be restored. Example: cw -N -NOSPLASH The No splash flag suppresses the display of Codewrights opening splash screen. This can save a small amount of loading time. Example: cw -NOSPLASH
164
Flags
-P <section> The paragraph flag tells Codewright to read the named section of the configuration file. The section will be read after all of the standard portions of the configuration file have been read, to give it priority over the other contents of the configuration file. For additional information about configuration files and their contents, consult the "Configuration and State" chapter of this manual. The section argument to this flag is the name of the section of the configuration file to be processed. If you name a section that is automatically read at startup, it will be processed twice. This section name may contain whitespace. If it does, however, it must be enclosed in either single or double quotes. Examples: cw -p "Windows driver" -S <stateLoc> The state location flag allows you to specify the directory or file in which state information is to be found. The stateLoc argument names that directory or file. If stateLoc names only a directory, Codewright looks for a file named CWRIGHT.PST in that directory, from which state information is read. If stateLoc names a complete path, including filename, Codewright will attempt to read state information from that file. When this flag does not appear on the command line, Codewright looks for a state information file in a series of places, unless the saving and restoring of state information has been turned off. These places include: a directory or file named by the CWPST environment variable, in CWRIGHT.PST in the Working Directory, in CWRIGHT.PST in the directory in which the CW.EXE or CW32.EXE file is located, or in a location named in CWRIGHT.INI.
This default search for state information is described in greater detail in the "Configuration and State" chapter of this manual. Example:
165
Command Files
cw -s h:\home\ericj -SThis is a special form of the state location flag that instructs Codewright not to read a state file. State information, however, is not automatically reinitialized, and may be used subsequently. Example: cw -s-X <function> The execute function flag names a function to be invoked as part of Codewright startup. This function should not attempt to perform any configuration, since such configuration may be overridden or reversed by the subsequent processing of the configuration and state files. The function argument to this flag contains the function call. If the call contains any parameters to the function, the entire function call must be enclosed in single or double quotes. In addition, it must conform to the syntax required by LibFunctionExec. For more information about this format, refer to the "Using the Editor -- The Command Key" section of this manual. Example: cw -X"special_init 1"
Command Files
@<commandFile> A command file is a file that may contain any valid command line parameters, including additional command files. Codewright identifies filenames preceded by an @ sign as command files. Command files are useful for overcoming command line length limits and also for creating reusable, logical groupings of filenames and flags. Parameters within a command file may be separated by whitespace or newlines. Newlines are often used to promote readability.
166
They each take a parameter that has a foreground/background combination encoded into a byte. Each nibble of the byte contains a value corresponding to one of 16 predefined colors. The most significant nibble describes the background color and the least significant nibble describes the foreground.
167
Palette Settings
Palette Settings
The table below shows the default red, green and blue values used for each of the predefined colors. The function AttrSetPaletteEntry allows you to change these mappings:
Color Black Blue BlueGreen Green Red Purple Brown Gray DarkGray LightBlue LtBlueGreen LightGreen LightRed LightGray Yellow White
Green 0 0 128 128 0 0 128 128 64 0 255 255 0 192 255 255
168
Web Page
You can access our home page on the Internets World Wide Web using the following URL: http://www.premia.com. Information and services available there include: messaging to sales and tech support pricing and product descriptions problem report form downloading of add-ons and patches
Internet Mail
You can send email to support@premia.com, and we will assist you as soon as practical. For sales matters, use the address sales@premia.com.
CompuServe
Premia has a section in one of the Windows Vendor Forums on CompuServe. You can type Go Premia at any ! prompt, or look in the WinAPA forum, section 9. You may also reach us at 70673,2627.
169
Fax
Fax
A fax will normally get a quick response. Our fax number is (503) 641-6001.
Phone Support
If you urgently need some information in order to continue using Codewright Professional, or if you have an urgent bug report, give us a call. The phone number is (503) 641-6000.
Maintenance Policy
Registered users who report bugs that are later fixed are entitled to a patched version or copy of maintenance release software.
170
Steps to Merging
This section describes a relatively simple method of merging your Codewright V4.0 source files with the source files provided in the Codewright Professional V5.0 release. The method described does not try to conserve disk space, and could use as much as 18MB for all Codewright files. Most users will not require nearly this amount, and additional steps may be taken which will substantially reduce this requirement. So that you will know where this space is going, here is a table of the maximum expected disk storage requirements:
Category Old Installation New Installation Original CWSTART Source Merged CWSTART Source
171
Steps to Merging
Identify Merge Candidates
Compare the dates on the source files in Codewright's sub directories to the release date. Most of the source files should be marked with the release date, but if you are in doubt, compare the source file date to the date on the CW.EXE or CW32.EXE file. If you have PKZIP available, you will probably find it useful to execute a DOS command like the one below in each of your Codewright source code subdirectories from your old installation: pkzip -t040494 modified *.c *.h Substitute the date on your Codewright executable in place of the 040494 in the command above. When you have done this, you will not only have archived your modified files, you will have also generated a list of these files that you can view or capture with a command like the one following: pkunzip -v modified
172
Steps to Merging
Install AutoMerge
Find the disk marked Best of BBS in your new Codewright Professional V5.0 distribution disks, and locate the file AUTOMG.EXE. If you have the CD version of Codewright, you will find the Best of BBS disk in a subdirectory named BBS16 or BBS32, depending on whether you are using the 32 bit version of Codewright or the 16 bit version. If you have trouble locating this file, check the file MANIFEST.TXT in the root of that disk or directory. AUTOMG.EXE is a self-extracting executable that contains the AUTOMRG.DLL and its source In a DOS shell, log to the new executable directory for Codewright Professional V5.0 and Run AUTOMG.EXE from the disk, using a command like the one below: b:\utils\automg automrg.dll This will extract just the DLL. If you later want the source, you can create a subdirectory and extract the entire executable into it by running AUTOMG with no parameters. Next, run Codewright V5.0 and load the configuration file CWRIGHT.INI in its executable directory. Locate the [LibPreload] section of the file and add a line to load the AUTOMRG.DLL library as follows: [LibPreload] LibPreload=automrg.dll
173
Steps to Merging
used in our example, CW40 and CWBASE. If you used other names or your files are on another drive, substitute those names in the commands above. The last directory in these paths will need to change as we go on to merge files in another directory. The rest should stay the same. You need only change the path and save the file. You need not restart Codewright for these changes to take effect. At this point, however, we do need to restart Codewright to allow the AutoMerge DLL to be loaded.
The AutoMerge function creates a .MRG file for each of the files you modified. Continuing our example, AutoMerge would create the files UTIL.MRG and ERRORFIX.MRG in the C:\CWRIGHT\CWSTART subdirectory. Note that this is the subdirectory for your original installation. Modify your CWRIGHT.INI file so that the commands in your [Merge] section point to the next directory of files to merge, load the files in that directory and repeat the process. When you have repeated this for all of the subdirectories on your list, the merge is completed.
Resolve Conflicts
If conflicts were noted in any of the files you merged, load the .MRG file and search for six dashes at the beginning of a line (^------ with regular expressions on). This is how conflicts are identified within the file.
174
Steps to Merging
When you have resolved any conflicts in a merged file, you are ready to copy the file to the original filename in the new installations directory. For example, you might resolve conflicts in C:\CWRIGHT\CWSTART\UTIL.MRG and then copy it to C:\CW40\CWSTART\UTIL.C. If a version control system is available, it is advisable to put all four revisions of the file under version control before copying the file to its original name. Recompile the DLLs and test the features you previously added.
175
Usage
TAGSWnn {[OPTIONS] [SOURCEFILE|@LISTFILE]}
176
-pCOMPILEFILE Convert output tag file (specified by -t) into a compiled file suitable for use with Codewright. The output flag (-t) and the Codewright output format flags (-oc) must be specified for this flag, otherwise it is ignored. -lLOGFILE Output all activity to LOGFILE. The log file will be created in a LISTFILE format (i.e. suitable as input using the @LISTFILE syntax). The behavior regarding existing files is determined by the case of the switch as follows: -l (lower case) creates and outputs to a file overwriting any currently existing file -L (upper case) appends all output to the logfile if there is an already existing file -o[options] This switch is used to determine the output format to the output stream. [options] may be one of the following: e Epsilon (>= V6.0) tag format ( tokenString {tab} fileName {tab} characterOffset {tab} line ) This format is used by the Epsilon editor (V6.x) created by Lugaru Software and specifies the token identifier, the file name (including full path, normally), the
177
178
179
180
181
182
Appendix E -- Specifications
Line Length Limit
Lines are limited to 536,870,911 characters.
Buffers Limit
The maximum number of buffers is limited only by storage (memory and disk).
Windows Limit
The number of windows is limited by Microsoft Windows.
File Size
The total of all file being edited is limited by the Operating System or 536,870,911 characters, whichever is less.
Number of Files
The number of files being edited is limited to 65,535, subject to the limit on total file size given above.
183
184
??
Part 2,
Function Reference
186
Function Reference
This portion of the Codewright Professional Users Guide lists and defines API functions. These functions may be used in the configuration file, or in key assignments, and most may be used interactively, through the API Command Key. The syntax used by convention in these three contexts differs slightly, but since Codewright Professional gives you broad latitude in the syntax you use; the three are essentially interchangeable. The syntax used in the function descriptions below is the syntax recommended for the configuration file.
187
Return Value The value returned by the function is described here. provided for diagnostic purposes only.
This information is
You cannot test the return value of a function executed from the configuration file or from key assignments. You may, however, see return values when executing functions through the API Command Key, if you prefix the function call with a question mark. This can assist you in performing diagnostics and modifying flag values. See Also References The See Also section lists related functions which may further inform you, or which may serve as an alternative to the function just described.
188
Autosave
AssignMouseKeys=
Remarks
AssignMouseKeys assigns the standard functions to the mouse keys. It is primarily for use in keymaps. KmapAssign
See Also
Remarks
AttrSetPaletteEntry changes the definition of one of the colors in Codewright Professional's color palette. This can affect the appearance of the entire program.
Parameter entry
color
Description The table entry number (0 to 15) for which the color is to be changed.
The new Blue, Green and Red encoded value for the entry. The method of encoding this value is as follows: Select a value for each color from 0 to 255. Place each value in a separate byte of the color DWORD. Red goes in the least significant byte, green the next and blue the next. For example, the hex value 0x00FF7F3F specifies 0xFF for blue, 0x7F for green and 0x3F for red.
Default value when parameters not supplied The function reports a zero value if either parameter is omitted.
The Codewright Professional color palette and the factory supplied values are described in Appendix A of this manual.
Return Value
AttrSetPaletteEntry returns the value in the color table that has been replaced by the new value.
Remarks
Autosave specifies the time intervals used for automatic file backups, when enabled.
189
AutosaveDir
Parameter idleTime Description The number of seconds of keyboard inactivity that must elapse before an auto-save is performed. A zero value effectively turns the feature off.
The number of minutes of editing time that must elapse before a save is performed, regardless of keyboard activity.
forceTime
Using this function to set both time parameters to zero effectively turns this feature off.
See Also
AutosaveDir
AutosaveDir=<"dir ">
Remarks
AutosaveDir permits you to specify a directory in which you wish to have auto-save files created. Auto-save is a feature that periodically saves your edit file, normally to a filename or directory other than the original.
Parameter dir
Description A string containing the name of the directory in which auto-save files are saved.
If a directory for auto-save files is not specified in this manner, the auto-save file is created in the same directory in which the original file resides.
See Also
Autosave
BackTab=
Remarks
BackTab is the function normally assigned to the %7 keystroke. If a selection is defined, the function outdents the block. If no selection is defined, the function moves the cursor to the preceding tabstop. Tab, SlideOut, SlideIn
See Also
BlockCopy=
190
BraceMatch
Remarks
BlockCopy copies the current selection to either the current scrap buffer or the Windows Clipboard, whichever is the designated data staging area. An informative message is printed to indicate the type of selection and the destination. BlockCut, Paste
See Also
BlockCut=
Remarks
BlockCut cuts (copies and deletes) the current selection to either the current scrap buffer or the Windows Clipboard, whichever is the designated data staging area. An informative message is printed to indicate the type of selection and the destination. BlockCopy, Paste
See Also
Remarks
Brace processes the current buffer, looking for unmatched curly braces. The cursor is positioned on the first unmatched curly brace, if one is found.
Parameter commentsToo
Description If this parameter is TRUE, the function does not exclude braces that occur within the C language comments of the file ( /* */ and // ). If FALSE, only braces outside of comments will be considered for matching.
Remarks
BraceMatch searches forward, beginning at the current position, for a matched pair of curly braces, { }, and optionally parentheses, ( ). The matched set and any text between them are highlighted.
Parameter parens_too
Description If TRUE, match the next set of {} or (), otherwise just {}.
191
BraceMatchNext
Default values when parameters are not supplied parens_too FALSE
If a '}' or ')' is encountered first, the function searches backward for a previous matching '{' or '(' . Since this function always begins the search with the current position, it is not well suited for highlighting a series of matched braces. It will continue to find the currently highlighted set.
BraceMatch returns TRUE when a matched set of braces or parentheses are found. If none were found, or an unbalanced set was found the function returns FALSE. Brace, BraceMatchNext
Remarks
BraceMatchNext searches forward for a matched pair of curly braces, { }, and optionally parentheses, ( ). The matched set and any text between them are highlighted.
Parameter parens_too
Description If TRUE, match the next set of {} or (), otherwise just {}.
BraceMatchNext returns TRUE when a matched set of braces or parentheses are found. If none were found, or an unbalanced set was found the function returns FALSE. Brace, BraceMatch
BufBackspace=<DWORD count>
Remarks
BufBackspace removes one or more characters preceding the current position in the buffer.
192
BufDelChar
Parameter count Description The number of characters to remove.
This function returns 0 if the operation is successful. It returns -1 upon error, such as when there is no current buffer or the buffer is read-only. BufDelChar
BufDelChar=<DWORD count>
Remarks
BufDelChar removes characters from the buffer, beginning at the current position. While the function will delete the end-of-line sequence when the count parameter so indicates, it will not delete beyond the end of the current line, regardless of the value of count.
Parameter count
Return Value
BufDelChar returns zero to indicate success, even if fewer than the specified number of characters are available for deletion. It only returns non-zero if the buffer is read only or if there is no current buffer. BufDelLine
See Also
193
BufDelLine
BufDelLine=<DWORD count>
Remarks
BufDelLine removes one or more lines from the buffer, beginning with the line containing the current position.
Parameter count
Return Value
BufDelLine returns zero to indicate success, even if fewer than the specified number of lines are available for deletion. It only returns non-zero if the buffer is read only or if there is no current buffer. BufDelChar
See Also
BufDelSelection=
Remarks
BufDelSelection removes the current selection. The contents of the selection is not placed in the scrap buffer. It may, then, only be recovered by executing Undo. On success, BufDelSelection returns 0. If no selection was defined, the function returns a non-zero value. BufDelChar
BufDelToEOL=
Remarks
BufDelToEOL removes characters from the current position to the end of the line. It does not remove the end of line marker.
194
BufEditFile
Return Value
BufDelToEOL returns zero to indicate success, even if the cursor is already at the end of the line, and it therefore deletes nothing. It only returns non-zero if the buffer is read only or if there is no current buffer. BufDelLine
See Also
BufEditFile=<"file">
Remarks
BufEditFile creates a new buffer for the specified file and assigns it to the current window. If no window is currently defined, one is created. If the system flag is set that indicates One buffer per window a window is created for each file read into a buffer. The buffer or buffers are added to the buffer list following the one that was previously current, if any. If a file opened by BufEditFile is already loaded, it is made current.
Parameter file
Description The filename and optional path of the file to be edited. May contain DOS standard wildcard characters.
195
BufInsertChar
BufInsertChar=<int key>
Remarks
Parameter key
Default value when parameter not supplied key Ascii portion of the current keycode
This function causes the current position in the buffer to be advanced. If the character is inserted beyond the end of a line, the virtual space is filled with spaces or tabs to the position at which the character was inserted. If a keycode is used as a parameter to this function, the ASCII portion of that code is inserted into the buffer. Newline characters (0x0A) may be inserted with this function. They will, however, be inserted by calling the BufInsertEOL function. Likewise, inserting a tab character with this function will result in the appropriate tab expansion being inserted in the buffer -that is, a tab if "use tabs" is enabled and otherwise the appropriate number of spaces. To insert a raw newline or tab, use the BufInsertStr function.
See Also
BufInsertStr, BufInsertEOL
BufInsertEOL=
Remarks
BufInsertEOL inserts a newline sequence at the current position. This has the effect of moving the cursor to the beginning of the new line. The specific newline sequence inserted will be either a carriage-return and line-feed, or just a line-feed, depending on the buffer setting selected. The factory setting is the carriage-return and line-feed combination.
BufInsertFile=<"path">
196
BufInsertScrap
Remarks
BufInsertFile reads the named file into the buffer at the current position.
Parameter path
Return Value
On success, BufInsertFile returns 0. If the file could not be found, or some other error occurred, a non-zero value is returned to indicate the nature of the failure.
BufInsertScrap=
5HPDUNV
BufInsertScrap inserts the contents of the Scrap buffer into the edit buffer at the current position. The resulting cursor position depends on the type of selection used to place the text into the scrap buffer.
There are other functions which performs similar operations on the Windows Clipboard. These functions begin with the Clipboard... prefix.
This function returns 0 unless the Scrap buffer is empty. In that case, it returns a nonzero value. BufCopyToScrap, BufCutToScrap, BufAppendToScrap
197
BufInsertStr
BufInsertStr=<"string">
Remarks
BufInsertStr inserts the supplied string into the buffer at the current buffer position.
Parameter string
See Also
BufInsertChar, BufInsertEOL
BufSetAutoIndentMode=<WORD mode>
5HPDUNV
BufSetAutoIndentMode sets the fill mode to be used by the auto indent feature. This function does not turn auto-indent on or off.
Parameter mode
Description A value from 0 to 4 indicating the method of filling white space at the beginning of lines, when auto-indent is in effect. Labels for the values and their meaning appear below: Description Immediately fills the indent by duplicating exactly the whitespace present on the preceding line. Used with AUTO_INDENT_VIRTUAL, searches backward, skipping empty lines, until it finds a line with text on it. The white space on the new line is modeled after that line.
Value Label
AUTO_INDENT_DUPLICATE AUTO_INDENT_SEEK
198
BufSetBackupSpec
AUTO_INDENT_SPACE AUTO_INDENT_TAB AUTO_INDENT_TABMODE AUTO_INDENT_VIRTUAL
Immediately fills the indent with spaces, even if the line receives no further edits. Immediately fills the indent optimally (tabs, then spaces as needed), even if the line receives no further edits. Immediately fills the indent with spaces, or spaces and tabs, depending on whether tab usage is enabled. Positions the cursor at the indented position on new lines, but does not fill until the line is edited.
BufSetAutoIndentMode returns the old fill mode for auto-indent. If the value for the parameter is out of range, the function returns -1. BufSetAutoIndent, BufQAutoIndentMode
BufSetBackupSpec=<"format">
5HPDUNV
Parameter format
Description The format string describing the location where backup files are placed.
199
BufSetGlobalBackupSpec
Format Control %b %d
%[{...}]e
Description
The entire name of the output file (fully qualified). Includes the path and drive (volume) specifier, but only ends with a backslash if describing the root directory. Includes the dot, unless the name of the output file has no extension. May optionally contain a transformation pattern. The root name and extension. Does not contain the drive (volume) or filename. Always ends with a backslash. Does not contain extension, drive (volume) or path. May optionally contain a transformation pattern. The drive letter and the colon. A single percent sign is represented by two consecutive percent signs (%%).
%f %p %[{...}]r %v %%
Example: BufSetBackupSpec("%b%{??~|__}e") The initial default for this local backup specification is an empty string. This means that the global backup specification is relied upon for locating and naming backup files. If the global string is also empty, backups are effectively turned off. Formatting strings, transformation patterns and the subject of backup files are discussed, and examples provided in the "General Operations -- Backup Files and Directories" section of this manual.
BufSetBackupSpec returns 0 on success, and non-zero on failure. The most likely cause of this function failing is when there is no current buffer. BufSetGlobalBackupSpec, BufQBackupSpec, BufQGlobalBackupSpec
BufSetGlobalBackupSpec=<"format">
5HPDUNV
200
BufSetTabStr
Parameter format Description The format string describing the location where backup files are placed.
BufSetTabStr=<"tabPicture">
5HPDUNV
Parameter tabPicture
Description Contains a list of column numbers at which tab stops are to occur. If tab stops are at regular intervals, only the first two need to be
201
BufSetTabUsage
named. The distance separating the last two entries is repeated to the limit indicated by BufQMaxTabCol.
6HH $OVR
BufSetTabUsage=<BOOL use_tabs>
5HPDUNV
BufSetTabUsage sets whether a tab character or spaces are inserted into the buffer when the tab key is pressed. It also determines how virtual space is filled when characters are inserted beyond the end of a line.
Parameter use_tabs
202
BufWriteFile
The initial default for this feature enables the use of tab characters.
6HH $OVR
BufWrite=
BufQTabUsage
Remarks
BufWrite writes the contents of the current buffer to its assigned output filename. This changes the value of the buffer's SysFlags. This function returns 0 upon successful completion. If an error occurs, a non-zero value is returned, indicating the nature of the failure.
Return Value
BufWriteFile=<"filename">
Remarks
BufWriteFile writes the contents of the current buffer to the file named by the parameter.
Parameter filename
Description The name of the file, and optionally its path, to which the current buffer is written.
Return Value
BufWriteFile returns 0 upon successful completion, and a non-zero value when an error occurs. The most likely causes of an error are either an invalid path, or insufficient storage available. BufWrite, BufWriteSelection
See Also
203
BufWriteSelection
BufWriteSelection=<"path">
Remarks
BufWriteSelection writes the contents of the currently defined selection to the specified filename.
Parameter path
Description The string containing the output filename and optional path.
On successful completion, BufWriteSelection returns zero. If an invalid path is specified or no selection is marked, the function returns a non-zero value. BufWrite
CenterLine=
Remarks
CenterLine scrolls the current window up or down so that the line that the cursor is on is in the center of the window. It is useful for showing the context surrounding text that matched a search, for example. ToBottom, ToTop
See Also
Remarks
CheckIn executes a command to check a file into a version control system or other archive.
Parameter cmd
Description A string containing the command line that performs the check-in. If this parameter is a NULL, the command "PUT %b%e" will be used. The command may contain any of the following escape
204
CheckIn
sequences, which are decoded using the other parameters of this function:
Escape %% %B
%b %D %d %E %e %n %p %R %r %V %v project
Meaning
% (a single percent sign) The basename (the complete filename, except for the extension) of the version control archive. The basename (the complete filename, except for the extension) of the workfile. The directory of the version control archive. (only ends in backslash if root directory) The directory of the workfile. (only ends in backslash if root directory) The extension of the version control archive. (includes the dot, unless extension is null) The extension of the workfile. (includes the dot, unless extension is null) The project name, as named by the project parameter. The path element of the filename (ends with a backslash) The root of the version control archive. (filename less path and ext.) The root of the workfile. (filename less path and extension.) The volume of the version control archive. (drive letter and colon) The volume of the workfile to check-in. (drive letter and colon)
A string naming the project of which the file to be checked-in is part. The %n project name escape sequence is based on the content of this string. This parameter is not currently used. It may therefore be NULL. It is not required by Codewright Professional as currently implemented, but is available in the event that it is useful to, or required by a version control system. A string containing the filename of the file to check-in. All the escape sequences above are based on the filename in this string, except %n.
archive
file
Default value when parameter not supplied cmd project archive NIL NIL NIL Return Value See Also
file NIL
CheckIn returns the error level resulting from the execution of the command, or -1 if an error prevents execution. ExecComand, CheckOut
205
CheckInBuffer
CheckInBuffer=<"filename">
Remarks
CheckInBuffer executes the CheckIn function on the specified buffer. The buffer is saved to disk before the check-in command is executed.
Parameter filename
Description A string containing the filename of the buffer to be checked in. If this string is empty or a NULL the function uses the effective output filename for the current buffer.
CheckIn, CheckOutBuffer
CheckInSetCmd=<"command">
Remarks
CheckInSetCmd sets the command line to be used for checking in a file under a version control or other archiving system. This function operates in support of the Check-in dialog box, and may appear in your Codewright Professional configuration file.
Parameter command
Description A string containing the command line to execute when checking in a file is requested. The file to be checked in is selected in the dialog box, but that name is not automatically added to the command line. A series of macros are available for referencing
206
CheckOut
portions of the selected filename within the command line. Those macros are listed below:
Macro %b %d %e %n %p %r %v %%
Element of Selected Filename(s) The basename (drive, path and root -- no extension) The directory (path with no trailing backslash, no drive) The extension (begins with the dot) The project name The path (ends with a trailing backslash) The root (filename less drive, path and extension) The volume (drive letter and colon) Percent sign
Default value when parameter is not supplied command NIL See Also
CheckOutSetCmd
Remarks
CheckOut executes a command to check-out a file from a version control system or other archive.
Parameter cmd
Description A string containing the command line that performs the check-out. If this parameter is a NULL, the command "GET %b%e" or "GET -l %b%e" will be used, depending on the condition of the lock parameter. The command may contain any of the following escape sequences, which are decoded using the other parameters of this function: Meaning
% (a single percent sign) The basename (the complete filename, except for the extension) of the version control archive. The basename (the complete filename, except for the extension) of the workfile.
Escape %% %B
%b
207
CheckOutBuffer
%D %d %E %e %n %p %R %r %V %v project
The directory of the version control archive. (only ends in backslash if root directory) The directory of the workfile. (only ends in backslash if root directory) The extension of the version control archive. (includes the dot, unless extension is null) The extension of the workfile. (includes the dot, unless extension is null) The project name, as named by the project parameter. The path element of the filename (ends with a backslash) The root of the version control archive. (filename less path and ext.) The root of the workfile. (filename less path and extension.) The volume of the version control archive. (drive letter and colon) The volume of the workfile to check-in. (drive letter and colon)
A string naming the project of which the file to be checked-out is part. The %n project name escape sequence is based on the content of this string. This parameter is not currently used. It may therefore be NULL. It is not required by Codewright Professional as currently implemented, but is available in the event that it is useful to, or required by a version control system. A string containing the filename of the file to check-in. All the escape sequences above are based on the filename in this string, except %n. This parameter is only used when the cmd parameter is null. It selects between the default command lines for checking out a file without or with a lock. If TRUE, the default command is "GET -l %b%e". If FALSE, the command used is "GET %b%e".
archive
file
lock
Default value when parameter not supplied cmd project archive NIL NIL NIL
file NIL
lock FALSE
CheckOut returns the error level resulting from the execution of the command, or -1 if an error prevents execution. ExecCommand, CheckIn
208
CheckOutSetCmd
Remarks
CheckOutBuffer executes the CheckOut function to replace the specified buffer and associated file with one that has been previously archived. The checked-out version of the file is loaded into the buffer. The "check-out w/Lock" command is used to signal an intention to modify the file.
Parameter withLock
Description When this parameter is TRUE, the "check-out w/Lock" command is used to signal an intention to modify the file. When FALSE, the "check-out for browse" command is used.
A string containing the filename of the buffer to be checked out. If this string is empty or a NULL the function uses the effective output filename for the current buffer.
filename
Default value when parameter not supplied filename withLock NIL FALSE
Use this function with caution. Any unsaved edits will be lost, and the existing file will be overwritten without further prompting.
CheckOut, CheckInBuffer
Remarks
CheckOutSetCmd sets the command line to be used for checking in a file or file under a version control or other archiving system. This function operates in support of the Check-out dialog box.
Parameter lockIt
Description When TRUE, this function specifies the command line for checking out a file with a lock, indicating the intention to modify
209
ClipboardEnableSepStr
the file. The locking capability is not supported by all version control and archiving systems. When FALSE, this function specifies the command line for checking out a file without locking it. This is usually referred to as getting a "browse" copy, and is often write-protected. command A string containing the command line to execute when checking out a file is requested. The file to be checked out is selected in the dialog box, but that name is not automatically added to the command line. A series of macros are available for referencing portions of the selected filename within the command line. Those macros are listed below:
Macro %b %d %e %n %p %r %v %%
Element of Selected Filename(s) The basename (drive, path and root -- no extension) The directory (path with no trailing backslash) The extension (begins with the dot) The project name The path (ends with a trailing backslash, no drive) The root (filename less drive, path and extension) The volume (drive letter and colon) Percent sign
Default value when parameter is not supplied lockIt command FALSE NIL See Also
CheckInSetCmd
ClipboardEnableSepStr=<int state>
5HPDUNV
ClipboardEnableSepStr enables or disables the use of a clipboard separator string. The clipboard separator string is used to separate lines or line segments when they are copied from a Codewright Professional buffer to the Windows Clipboard.
Parameter state
Description When non-zero, the separator string is enabled. When zero, the separator is disabled.
210
ColorCommandLine
Default value when parameter not supplied state TRUE
The function ClipboardSetSepStr defines the string. This function enables or disables its use. The initial setting for this feature is enabled.
ClipboardEnableSepStr returns the previous state, enabled (non-zero) or disabled (zero). ClipboardEnableTermStr, ClipboardSetSepStr, ClipboardQSepStr
ClipboardSetSepStr=<"sepStr">
5HPDUNV
ClipboardSetSepStr assigns a new value to the clipboard separator string. The clipboard separator string is used to separate lines or line segments when they are copied from a Codewright Professional buffer to the Windows Clipboard.
Parameter sepStr
Description A pointer to the string containing the new value for the clipboard separator string.
6HH $OVR
ColorCommandLine=<int ColorCode>
Remarks
ColorCommandLine sets the foreground and background color that is applied to the Codewright Professional API command line .
211
Color...
Parameter ColorCode Description The code indicating the foreground and background color desired. A value of -1 for this parameter causes the function to report the current setting without modifying it.
ColorCommandLine returns the code of the color in effect when the function was called. ColorError, ColorWarning, ColorMessage
Color... ColorComments=<int color> ColorDiffAdd=<int color> ColorDiffDel=<int color> ColorInsertedLines=<int color> ColorKeywords=<int color> ColorModifiedLines=<int color> ColorLinenumbers=<int color> ColorSelection=<int color> ColorText=<int color>
Remarks
The Color... functions set or retrieve the color setting for various objects for the current window. The table below describes which of these functions sets which objects:
Function
ColorComments ColorDiffAdd ColorDiffDel
Object The color used, when Language Dependent ChromaCoding is on, to color comments in the source code. The color applied to lines that are flagged as added in the output of a File Difference operation. The color applied to lines that are flagged as deleted in the output of a File Difference operation.
212
ColorError
ColorInsertedLines ColorKeywords ColorLinenumbers ColorModifiedLines ColorSelection ColorText
The color used, when Changed Lines ChromaCoding is on, to color lines that have been inserted during the current edit session. The color used, when Language Dependent ChromaCoding is on, to color keywords in the source code. The color used for the line numbers that appear to the left of each line, when enabled. The color used, when Changed Lines ChromaCoding is on, to color lines changed during the current edit session. The color used for the selection (marked block). The color used for normal, unselected text.
Parameter
color
Description
The id of the foreground/background combination to be used. Color ids are listed in Appendix A of this manual.
The Color... series of functions return the id of the color previously in use for the object in question. ColorCommandLine, ColorError, ColorMessage, ColorWarning
ColorError=<int ColorCode>
Remarks
ColorError sets the foreground and background color applied to error messages.
Parameter ColorCode
Description The code indicating the foreground and background color desired. A value of -1 for this parameter causes the function to report the current setting without modifying it.
213
ColorMessage
A table listing the 16 color combinations available appears in Appendix A of this manual.
ColorError returns the code of the color in effect when the function was called.
ColorMessage=<int ColorCode>
Remarks
Parameter ColorCode
Description The code indicating the foreground and background color desired. A value of -1 for this parameter causes the function to report the current setting without modifying it.
ColorMessage returns the code of the color in effect when the function was called.
ColorWarning=<int ColorCode>
Remarks
ColorWarning sets the foreground and background color applied to Warning messages.
Parameter ColorCode
Description The code indicating the foreground and background color desired. A value of -1 for this parameter causes the function to report the current setting without modifying it.
214
ConfigFileRead
Default value when parameter is not supplied ColorCode -1 (reports the current setting)
A table listing the 16 color combinations available appears in Appendix A of this manual.
ColorWarning returns the code of the color in effect when the function was called.
ColorWarning=<int ColorCode>
5HPDUNV
ColorWarning sets the foreground and background color applied to Warning messages. These are the messages displayed using the MsgWarning function.
Parameter ColorCode
Description The code indicating the foreground and background color desired. A value of -1 for this parameter causes the function to report the current setting without modifying it.
Default value when parameter not supplied ColorCode -1 (reports the current setting)
A table listing the 16 color combinations available appears in Appendix A of this manual. These color combinations may be modified using the ColorSetPallete function.
ColorWarning returns the code of the color in effect when the function was called. ColorError, ColorText, ColorMessage
5HPDUNV
215
CWHelp
Parameter fname Description A pointer to the string containing the name and path of the configuration file. If the string is empty, Codewright Professional uses the configuration file read at startup.
The name of the paragraph or section that is processed. This name is specified without the enclosing square brackets that are required in the file. When TRUE, this parameter indicates that the configuration file is to be left open for impending updates. This speeds the process of updating the file. The file must not be left open indefinitely, however. If it is, another source may attempt to update the file, which could result in a sharing violation.
sectionName
leaveOpen
Default value when parameter not supplied fname sectionName leaveOpen NIL NIL FALSE
Remarks
CWHelp calls the appropriate help library, based on the parameters and filenames defined.
Parameter key
Description This long integer can be either a string containing the name of the topic, or a 32 bit context identifier, depending on the mode specified. The latter is for looking up a topic by number.
A value, as defined in WINDOWS.H, indicating the look-up method to use. A list of accepted values and their labels appears below:
Label
HELP_KEY
mode
Description
Perform a lookup on the string pointed to by the key parameter. Perform a numeric lookup on the contextidentifier in the key parameter. Ignore the key parameter and display help on using Help.
HELP_CONTEXT
HELP_HELPONHELP
216
DeleteNextWord
HELP_INDEX
Ignore the key parameter and display an index of the Codewright Professional help library.
Default value when parameter not supplied key mode NIL HELP_KEY
If a default help library has been named with the CWHelpDefaultName function, special action is taken whenever a topic cannot be located in Codewright Professional's internal tables. In that case, WinHelp is called upon to find the topic in that default library.
Return Value
CWHelp returns TRUE if the help executable is called. FALSE is returned otherwise.
DefaultKeymap=<"keymapName">
Remarks
Parameter keymapName
Description A string containing the name of the keymap function, which is also the basename of the DLL containing that function. For example "cwvbrief", "cwvcua" or "mykeys". The keymap function must install and initialize the keymap.
Default value when parameter not supplied keymapName NIL Return Value
DefaultKeymap returns TRUE if the keymap DLL was found and loaded, and the keymap function was found and invoked. QDefaultKeymap
See Also
DeleteNextWord=
217
DeletePrevWord
Remarks
DeleteNextWord deletes from the cursor position to the beginning of the next word. The NextWord function is used to determine the beginning of the next word. As supplied, NextWord defines the beginning of a word as the first non-whitespace character immediately following the next space, tab or newline. If you modify NextWord this function will operate differently. NextWord, DeletePrevWord
See Also
DeletePrevWord=
Remarks
DeletePrevWord deletes from the cursor position to the beginning of the previous word. The PrevWord function is used to determine the beginning of the next word. As supplied, PrevWord defines the beginning of a word as the first non-whitespace character immediately following the preceding space, tab or newline. If you modify PrevWord this function will operate differently. DeleteNextWord
See Also
DisplayFileName=
Remarks
DisplayFileName displays the name associated with the current buffer. This will be the buffer name, if one is defined. Usually, no buffer name has been defined, in which case this function prints the original filename from which the buffer was read.
Dlg...
218
Dlg...
DlgBufferSave=0, <"caption"> DlgBufSettings= DlgDiff= DlgExtensionConfig= DlgFFind= DlgFGrep= DlgFileBuild= DlgFilter= DlgKeys= DlgMarkGoto= DlgMarkGotoLine= DlgMarkSet= DlgMerge= DlgMultiBufSearch= DlgMultiFileSearch= DlgOpenFile= DlgPrint= DlgPrintSetup= DlgSaveAs=0, <"initFilename"> DlgSelectDir= DlgSetSelectBuffer= DlgSysColor= DlgWinColor= DlgWinFont= DlgWinSettings=
Remarks
The Dlg... series of functions are functions that let you call dialog boxes directly. Many of them are available for assignment to a keystroke sequence. Those that return buffer handles or string pointers are intended for use in extension functions written by the user. A description of the purpose of each of these dialogs appears below:
Function
DlgBufferSave DlgBufSettings DlgDiff DlgExtensionConfig DlgFFind DlgFGrep DlgFilter DlgKeys
Dialog Invoked...
The Buffer Save dialog and saves the selected buffers. The Buffer Settings dialog to allow changing one or more buffer's settings. The Differencing dialog. The Extension-specific Settings dialog. The File Find dialog. The File Grep dialog. The Filter dialog (Not on any menu). The Key Bindings dialog.
219
DlgMenuPopup=<LPSTR menuName>
DlgMarkGoto DlgMarkGotoLine DlgMarkSet DlgMerge DlgMultiBufSearch DlgMultiFileSearch DlgOpenFile DlgPrint DlgPrintSetup DlgSaveAs DlgSelectDir DlgSetSelectBuffer DlgWinColor DlgWinFont DlgWinFontDefault DlgWinSettings
The Goto Mark dialog. The Goto Line dialog. The Mark dialog. The Merge dialog. The Multi-buffer dialog. The Multi-file dialog. The File/Open dialog. The Print dialog. The Printer Setup dialog. The File/Save As dialog. The File/Change Dir dialog. The Buffer Selection dialog, allows the user to select a new current buffer, and then assigns that buffer as current. The Colors dialog from the Options menu. The Font dialog from the Options menu. The Default Font dialog from the Options menu. The Settings dialog from the Options menu.
Parameter
caption
Description
The functions that accept a caption parameter string use it as a title for the dialog. These functions call multi-purpose dialogs and the supplied caption indicates the purpose in this instance. The function DlgSaveAs takes this parameter as a string to initially display in the Filename edit box. In many cases this is the name of the current buffer. If this pointer is NIL the edit box will initially be empty.
initFilename
DlgMenuPopup=<LPSTR menuName>
Remarks
DlgMenuPopup reads a popup menu definition from a file and displays the menu it describes.
Parameter
menuName
Description
The name of a popup menu definition section in the file CWRIGHT.MNU, or the name of a file containing a popup menus
220
EditPrevBuffer
definition. If the parameter is a section name, the parameter begins and ends with square brackets. Here is an example key assignment using the DlgMenuPopup function in your CWRIGHT.INI file: [KmapAssign] KmapAssign=<Mouse_right_click> DlgMenuPopup [Utilities]
DlgMenuExec=<LPSTR sectionName>
Remarks
DlgMenuPopup reads a section in the CWRIGHT.MNU file and executes the lines it contains sequentially.
Parameter
sectionName
Description
This parameter contains the name of a section in the file CWRIGHT.MNU that is a series of Codewright API calls. This parameter should begin and end with square brackets.
This function is intended primarily for use in the function call portion of an item definition line, but it may be assigned directly to a key, if desired.
EditNextBuffer=
Remarks
EditNextBuffer makes the next buffer in the buffer list current. The function skips any system buffers in the list. The name of the buffer made current is printed on the status line or in a pop-up window. EditPrevBuffer
See Also
EditPrevBuffer=
Remarks
EditPrevBuffer makes the previous buffer in the buffer list current. The function skips any system buffers in the list. The name of the buffer made current is printed on the status line or in a pop-up window.
221
EdVersion
See Also
EditNextBuffer
EdVersion=
Remarks
EdVersion displays Codewright Professional's version number on the status line or a pop-up message box.
ErrKmapAssign=<"keyName">, <"funcCall">
5HPDUNV
ErrKmapAssign makes key assignments to the Window keymap used for the Output Window. There are few assignments in this keymap by default. This prevents accidental editing.
Parameter keyName
funcCall
Description A string describing the key combination to which the function call is assigned (e.g., "<alt-a>").
A string describing the function call to assign to the key combination (e.g., "MovUp 1"). If this parameter is NIL the assignment is not made.
Default value when parameter not supplied keyid function_call NIL NIL
The method of representing key combinations in strings is detailed in "Key Bindings -Keymaps and Keystrings" section of this manual.
5HWXUQ 9DOXH
ErrKmapAssign returns TRUE upon successful completion, and FALSE if the assignment cannot be made. Failure is usually due to an invalid keystring, since the function assigned to it is not checked for validity at this time. KmapAssign
6HH $OVR
222
EvalStrDel
EvalStrAdd=<"label">, <long value>
Remarks
EvalStrAdd adds a string identifier to the list of those recognized by the expression evaluator. The string can then be used in place of a number, in expressions to be evaluated. This function may also be used to change the value associated with strings that are already defined.
Parameter label
value
Description The string which to associate with a numeric value. Case is significant in defining this string.
The numeric value to associate with the string.
Default value when parameter not supplied label value NIL 0 Return Value See Also
EvalStrAdd returns TRUE if the string definition was added to the list. If the string was already defined, and the change parameter is FALSE, the function returns FALSE. EvalStrDel
EvalStrDel=<"label">
Remarks
EvalStrDel deletes a string identifier from the list of those recognized by the expression evaluator.
Parameter label
Description The string identifier that to delete. Case is significant in specifying this string.
Default value when parameter not supplied label NIL Return Value
EvalStrDel returns TRUE if the label was found and deleted. If the label was not defined, the function returns FALSE.
223
ExecApp
See Also
EvalStrAdd
ExecApp=<"command">
Remarks
ExecApp executes a specified command line. If the command is not supplied in the parameter, the function prompts for it. The command line may invoke either a Windows or DOS application. If executing a DOS application, the subprocess terminates at the conclusion of the command.
Parameter command
Description A string containing the command line to execute, including any arguments and flags. When this string is empty or NIL, the function prompts for a command line.
ExecApp returns the exit code returned by the executed application, if any.
ExecCommand
ExecCommand=<"command ">
Remarks
ExecCommand spawns a command shell from which a command or a series of commands may be executed. The shell used is the one pointed to by the COMSPEC environment variable.
Parameter command
Description A string containing the command line to execute, including any arguments. If this string is omitted or empty, the command shell itself is run. The user must then type "Exit" to close the shell.
224
ExecUserCmnd
Default value when parameter not supplied command NIL Return Value
ExecCommand returns the error level returned by the executed command, or -1 if an error prevents execution. If just the command shell is invoked, the function will return 0.
Remarks
Parameter command
Description A command line which may contain macros referencing the name of the current buffer or some portion thereof. The following macros are defined for use in this parameter: Macro %b %d %e %p %r %v %% Element of Current Buffer Name The basename (drive, path and root -- no extension) The directory (path with no trailing backslash) The extension (begins with the dot, if not null) The path (ends with a trailing backslash) The root (filename less drive, path and extension) The volume (drive letter and colon) Percent sign
wflag
When this parameter is 0 the task is executed in the foreground. When this parameter is 1 the task is executed in the background.
Return Value
225
ExecuteMacro
See Also
ExecCommand
ExecuteMacro=<"funcStr">
Remarks
ExecuteMacro invokes an API or user-defined function provided in a string parameter. If the string is NIL, the command is prompted for.
Parameter funcStr
Description The string containing the name of the function to be executed and the parameters to provide to that function. If this string is NULL, the function prompts for this information. The case used for the function name is not significant.
Remarks
ExtAddKeyword adds a keyword to the table of keywords for Language Dependent ChromaCoding, associated with a specified filename extension.
Parameter ext
Description A string containing the extension with which the keyword is to be associated. This extension must be one for which there is built-in support, or one you have added support for. Support is currently built-in for the following extensions: .C, .CPP, .CXX, .PAS, .ASM, and if the appropriate DLLs are loaded .SC and .PRG.
A string containing the keyword to be colored by Language Dependent ChromaCoding, when enabled for the specified extension.
keyword
226
ExtAlias
Default value when parameter not supplied ext keyword NIL NIL Return Value See Also
ExtAddKeyword does not return a value
ExtReadKeywordFile
Remarks
ExtAlias confers a set of extension-specific attributes on an additional extension. Files with the specified extension (File Type) are processed in the same manner as a predefined type.
Parameter new
existing
Description A string containing the filename extension which is to be treated synonymously with another extension.
A string containing the filename extension that is currently processed in the desired manner.
Default value when parameter not supplied new existing NIL NIL
There are several features that are language-specific, and are predefined as applying to files with a certain extension. These features are ChromaCoding, Template Expansion, and Smart Indenting. For the purposes of these features, files with certain extensions are assumed to contain source code for a specific programming language. These assumptions are listed in the table below:
227
ExtAssignTemplate
There may be additional extensions to which you want to apply these language-specific features. For example, you may wish to classify files with the extension .INC as Assembly or Pascal files. The ExtAlias function allows you to do this. Some Windows CASE tools require that include files follow special naming conventions. ExtAlias allows you to follow these conventions without losing Codewright Professional's language-specific features for these files. Example: ExtAlias=".CWL",".C" This statement in your Codewright Professional configuration file would cause files with the extension .CWL to be treated as C language files for ChromaCoding, Template Expansion, and Smart Indenting.
Remarks
ExtAssignTemplate provides a means of adding or modifying language templates. You will find a general description of Language Templates in the General Operation chapter of this manual.
Parameter ext
Description A string containing the filename extension to which the template applies. The extension is used to identify files containing source code for a certain language. The template being defined only applies when the current buffer has this file extension.
A string containing the keyword or abbreviation that triggers template insertion. Pressing the space bar after typing this word inserts the template. A string containing the encoded template. There are special characters defined for use in language templates, that give Codewright Professional instructions. Here is a table of the special characters available, and their meanings:
keyw
templ
Char. \n & @
Purpose New Line. Simulates pressing enter at this point. Specifies cursor position after template insertion. Issues a backspace.
228
ExtColorsAssoc
\c Insert 'c' literally, (e.g., \&, \@, \\)
Default value when parameter not supplied ext keyw templ NIL NIL NIL
ExtColors=<int level>
Remarks
ExtColors controls the status of the ChromaCoding features. Use it to turn on the highlighting of programming language keywords and comments, or to turn on changed line highlighting.
Parameter level
Description When this parameter has a value of 1, ChromaCoding is enabled for keywords and comments. A value of 2 enables ChromaCoding for changed lines. These two modes are mutually exclusive. A zero value turns off ChromaCoding completely. To obtain the current status without changing it, supply a -1 value for this parameter.
Default value when parameter not supplied level -1 Return Value See Also
ExtColors returns the current setting of the ChromaCoding feature. ExtIndentEnable, ExtAssignTemplate
Remarks
ExtColorsAssoc enables or disables ChromaCoding for files having a specified extension, or for all extensions.
Parameter ext
Description A string containing the extension for which ChromaCoding is to be enabled or disabled. The extension .* causes the command to
229
ExtCommentSearchLimit
apply to all extensions, overriding the settings for specific extensions. level When this parameter is 0, ChromaCoding is turned off. A value of 1 for this parameter turns on Language Dependent ChromaCoding. A value of 2 turns on Changed Lines ChromaCoding. When this parameter is -1 the function reports the current state of ChromaCoding without altering it.
Return Value
ExtColorsAssoc returns the previous setting of ChromaCoding for the specified extension. This value is interpreted in the same manner as the level parameter above. ExtIndentEnableAssoc
See Also
ExtCommentSearchLimit=<long limit>
5HPDUNV
ExtCommentSearchLimit sets the maximum number of lines that ChromaCoding will scan, forward and backward from the cursor, to determine if that position is in a comment. The default setting for this feature is 30.
Parameter limit
Description The new line limit for searching for comment delimiters.
230
ExtExpandTemplate
5HWXUQ 9DOXH 6HH $OVR
ExtCommentSearchLimit returns the previous setting of the comment search limit. ExtColorsAssoc
ExtDelayedColoring=<int on>
5HPDUNV
ExtDelayedColoring turns on, off or reports the current setting of delayed coloring. This determines if a newly loaded file should be ChromaCoded first and then display (not delayed), or displayed and then ChromaCoded (delayed).
Parameter on
Description When this parameter is non-zero, delayed coloring is turned on. When it is zero, delayed coloring is turned off. If the value of this parameter is -1, the setting is not modified, but the function reports the current setting by way of the return value.
ExtDelayedColoring returns the new setting of the delayed coloring feature. ExtCommentSearchLimit
ExtExpandTemplate=<"template">
5HPDUNV
ExtExpandTemplate expands the specified template string. This is a relatively low level function that does no checking to see if the template expansion is appropriately placed.
Parameter template
Description A string containing the template to execute at the current cursor position. The string may require escape sequences and predefined macros. Macros are identified with a %. A list of these macros appears below:
231
ExtExpandTemplate
Macro form %colNum %date %db %dcNum %de %dlNum %dw %eEnVar$ %fFilename$
%home %lineNum %mdNum %meof %meol %mlNum %mrNum %muNum %Num
Description
Moves the cursor to column Num of the current line. Inserts a U.S. formatted date string at the current cursor position. (mm/dd/yy) Deletes to the beginning of the line. Deletes Num characters at cursor. Deletes to the end of the line. Delete Num line, beginning with the current. Delete the word at the cursor. Insert the string value associated with environment variable EnVar. Insert the named file at the cursor. Any template macros within the file are also processed. Move the cursor to the beginning of the line. Move the cursor to the line named by Num. Move down Num lines. Move the cursor to the end of the file. Move the cursor to the end of the line. Move the cursor left by Num columns. Move the cursor right by Num columns. Move up Num lines. When Num is 0 to 9, it refers to a user-definable string that may be defined differently for each extension. Any macros contained in these strings are also expanded. Typically, these assignments are made in CW??.EXT or your configuration file. The macros 0 through 3 are used for custom indentation in predefined language templates. See ExtSetTemplateMacro. Higher numbered macros (10 through 31) are not extension specific, but are otherwise similarly definable. They are reserved for the use of individual users.
Open a new line following the current. Similar to going to the end of the line and pressing . Query for string to insert, using the string Prompt to prompt the user. Insert Num repetitions of character C. Restore a saved position. Save a position for later restoration. Insert a formatted time string. (hh:mm:ss) Move cursor to the top (first line) of the file. Requires %home to assure positioning at the first character of the file.
232
ExtIndentEnableAssoc
%xFuncCall$
Execute the Codewright Professional API function call in FuncCall. This may be any function that could be assigned to a key or otherwise executed through LibFunctionExec.
ExtIndentEnable=<int level>
Remarks
ExtIndentEnable controls the smart-indenting and language template features of Codewright Professional.
Parameter level
Description When this parameter has a value of 1, Smart-indenting is enabled. A value of 2 enables Template Expansion and Smart-indenting. (Template Expansion relies on Smart-indenting and therefore cannot be enabled alone.) A zero value turns off both of these features. To obtain the current status without changing it, supply a -1 value for this parameter.
Default value when parameter not supplied level -1 Return Value See Also
ExtIndentEnable returns the current setting. ExtColors, ExtAssignTemplate
Remarks
ExtIndentEnableAssoc enables or disables Smart Indenting and/or Template Expansion for files having a specified extension, or for all extensions.
Parameter ext
Description A string containing the extension for which Smart Indenting/Template Expansion is to be enabled or disabled. The extension .* causes the command to apply to all extensions.
233
ExtKmapAssign
level When this parameter is 0 both Smart Indenting and Template Expansion are disabled. A value of 1 enables Smart Indenting. A value of 2 enables both Smart Indenting and Template Expansion. When this parameter is -1 the current setting is reported but is not altered.
Return Value
ExtIndentEnableAssoc returns the previous setting of Smart Indenting and Template Expansion for the specified extension. This value is interpreted in the same manner as the level parameter above. ExtColorsAssoc
See Also
ExtKmapAssign=<keyName>, <funcCall>
Remarks
ExtKmapAssign makes key assignments to the keymap overlay used for language indentation and template expansion.
Parameter keyName
funcCall
Description A string describing the key combination to which the function call is assigned (e.g., "<alt-a>").
A string describing the function call to assign to the key combination (e.g., "MovUp 1"). If this parameter is NIL the assignment is not made.
Default values when called from LibFunctionExec (Command Key) keyid function_call NIL NIL
The method of representing key combinations in strings is detailed in "Key Bindings -Keymaps and Keystrings" section of this manual.
234
ExtReadTemplateFile
Return Value
ExtKmapAssign returns TRUE upon successful completion, and FALSE if the assignment cannot be made. Failure is usually due to an invalid keystring, since the function assigned to it is not checked for validity at this time. KmapAssign
See Also
ExtReadKeywordFile=<"ext">, <"filename">
Remarks
ExtReadKeywordFile reads a series of keywords from a file and associates them with a specified extension. When Language Dependent ChromaCoding is enabled for that extension the added keywords will be colored.
Parameter ext
Description A string containing the extension with which the keywords are to be associated. This extension must be one for which there is builtin support, or one you have added support for. Support is currently built-in for the following extensions: .C, .CPP, .CXX, .PAS, .ASM, and if the appropriate DLLs are loaded .SC and .PRG.
A string containing the name of the file in which the list of additional keywords has been placed. The keywords in the file must be in the format of one keyword per line.
filename
Default value when parameter not supplied ext filename NIL NIL Return Value See Also
ExtReadKeywordFile returns TRUE when the keyword file is successfully found and read. The function returns FALSE otherwise. ExtAddKeyword
ExtReadTemplateFile=<"ext">, <"fname">
5HPDUNV
235
ExtSetDelimiters
Parameter ext Description A string containing the name of the extension to which the templates apply. This string may optionally begin with a dot. (e.g., ".C" or "cpp")
A string containing the name of the file in which the template definitions are found. The format of this file is one template assignment (or definition) per line. Each line contains two string parameters. They may each be enclosed in quotes and separated by whitespace. These are used as the last two parameters of the function ExtAssignTemplate. The first is the word or words that are to trigger the template insertion. The second parameter is the template that is inserted when triggered. This string contains % macros, escape sequences and literal text, as necessary to insert the desired form. See the description of ExtAssignTemplate for further details.
fname
Default value when parameter not supplied ext fname NIL NIL
5HWXUQ 9DOXH
ExtReadTemplateFile returns TRUE if the named file was found and read. This is not indicative of the contents of the file being in proper format. If the file could not be read or found, the function returns FALSE. ExtReadKeywordFile, ExtAssignTemplate
6HH $OVR
ExtSetDelimiters=<"ext">, <"delimiters">
5HPDUNV
ExtSetDelimiters is used to set extension-specific word delimiters in the Extensionspecific Settings file. It appears under the [Extension.xxx] headings in either the configuration file, the project file, or a user-defined file, depending on which option has been selected.
Parameter ext
Description A string containing the affected extension. If this parameter is NIL the delimiters for the current buffer's file type are set.
236
ExtSetStyle
delimiters A string containing those characters, in addition to whitespace, that separate words for this file type. This string is used as a character class in a regular expression. The characters - ^ " and ] therefore need to be escaped. Precede these characters with a backslash. If this parameter is NIL, the delimiters are not modified, but the current setting may be obtained from the return value.
Default value when parameter not supplied ext delimiters NIL NIL
ExtSetDelimiters returns a string containing the new set of delimiters for the specified extension. NextWord, PrevWord
5HPDUNV
ExtSetStyle sets or query Extension-specific indentation style used. At present, this function is only effective on C and C++ files for determining the positioning of braces when templates are expanded.
Parameter ext
level
Value 1 2
3
Meaning Braces on their own lines, not indented. Opening brace at end of line, closing brace on its own line. (K&R) Braces on their own lines, indented.
237
ExtSetTemplateMacro
5HWXUQ 9DOXH 6HH $OVR
ExtSetStyle returns the new setting for the indentation style for the specified extension. ExtQIndenting
5HPDUNV
ExtSetTemplateMacro sets the string associated with a numbered template expansion macro.
Parameter number
Description A number from 0 to 31 indicating which numbered macro is being defined. The macro may then be used in templates, by referencing this number preceded by a percent sign (e.g., %1, %3). Macros from 0 to 9 may be associated with an extension so that templates may operate differently for different languages.
The string to insert in place of the macro reference. This string may contain other % macros, escape sequences or literal text. For more information on % macros, refer to the description of ExtExpandTemplate. A string containing the file extension with which the macro is to be associated. This parameter is ignored if the number parameter is a value greater than 9, since these cannot be associated with an extension. For values 0 through 9, if this parameter is NIL the macro is not associated with any extension. It will then only be used if the current buffer has no corresponding macro defined for its extension.
macro
ext
Default value when parameter not supplied number macro ext 0 NIL NIL
6HH $OVR
ExtExpandTemplate, ExtAssignTemplate
ExtSetUpdateDelay=<int numCalls>
238
ExtSetWrap
5HPDUNV
ExtSetUpdateDelay sets the number of times that the ChromaCoding update function is called before it does a complete update. This allows you to control how quickly or how intrusively colors are updated.
Parameter numCalls
Description The number of times the update function is called before a complete update is triggered.
6HH $OVR
ExtCommentSearchLimit
5HPDUNV
ExtSetWrap determines whether the word wrap feature will be turned on or off for files with a specified extension.
Parameter ext
Description A string containing the extension with which the setting is to be associated. This may optionally begin with a dot. (e.g., ".txt" or "C")
When this parameter is 0, the word wrap feature is turned off. When it is a value of 1, word wrap is enabled, but only on the current line. Lines following may require reformatting as a result of edits. A value of 2 for this parameter enables continuous reformatting of the lines from the cursor to the end of the paragraph. See the function WrapEnable for a further description.
level
239
FFind
5HWXUQ 9DOXH 6HH $OVR
ExtSetWrap returns the new setting of the word wrap feature for the specified extension. WrapEnable, WrapSetRightMargin, WrapParagraph
FFind=<"filePattern">
5HPDUNV
FFind searches for files matching a specified pattern. It writes the names of matching files in a file for review. The name of the file in which the names of matching files are stored is set with the function FFindFile.
Parameter filePattern
Description A string containing the pattern for which a list of matching files is desired. The pattern may contain the standard DOS wildcard characters ? and *. If the pattern contains a path element, the scope of the search is limited to that directory and its subdirectories. If the pattern does not contain a path element, the search covers the current directory and its subdirectories.
FFindFile=<"filename">
Remarks
FFindFile defines the name of the file in which the FFind function will place the names of files that satisfy its search.
Parameter filename
Description A string containing the name of the output file for FFind.
240
FFindShow
Default values when parameters not supplied filename NIL Return Value
FFindFile returns the new output filename.
FFindNext=
Remarks
FFindNext highlights and processes the next entry in the File Find list of matching files. The indicated file is automatically loaded.
FFindPattern=<"defaultFPat">
5HPDUNV
FFindPattern defines the default filename search pattern for the DlgFFind function.
Parameter defaultFPat
Description A string containing the default filename pattern for the DlgFFind dialog (the pattern initially displayed). The pattern may contain the standard DOS wildcard characters ? and *. If the pattern contains a path element, the scope of the search is limited to that directory and its subdirectories. If the pattern does not contain a path element, the search covers the current directory and its subdirectories.
FFindPattern returns a string containing the new default pattern. FFindFile, FFind, DlgFFind
Remarks
FFindShow displays the list of files matching a recent File Find operation.
241
FGrepFile
See Also
DlgFFind
FGrepFile=<"outputFile">
5HPDUNV
FGrepFile defines the name of the message file in which FGrep and DlgFGrep place their output for review.
Parameter outputFile
Description A string containing the name of the message file used by the File Grep functions.
FGrepFile returns the new name of the message file. FGrep, DlgFGrep
FGrepFlags=<WORD flags>
5HPDUNV
FGrepFlags specifies the default search options used by FGrep if none are specified, and also the initial settings of these options in the DlgFGrep dialog.
Parameter flags
Description A value dictating the attributes of the search. The following values may be ORed together to obtain the desired combined value: Label
FGREP_DIRSEARCH FGREP_REGEX
FGREP_IGCASE
242
FGrepPattern
FGREP_BUFSEARCH
FGrepFlags returns the new value for the File Grep flags. FGrep, DlgFGrep
Remarks
FGrepNext highlight and processes the next entry in the File Grep list of locations of matching text. The file containing the matching text is loaded, and the cursor is placed on the line containing the match. DlgFGrep, FgrepShow
See Also
FGrepPattern=<"defaultRegex">
5HPDUNV
FGrepPattern defines the text or regular expression search pattern initially displayed in the DlgFGrep dialog.
Parameter defaultRegex
Description A string containing the search pattern for the DlgFGrep dialog (the pattern initially displayed). The pattern may be an ordinary string search, or a regular expression, depending on the option flags specified.
5HWXUQ 9DOXH
243
FGrepScope
6HH $OVR
FGrepFile, FGrep, FGrepFlags, DlgFGrep
FGrepScope=<"defaultFPat">
5HPDUNV
FGrepScope defines the default filename search pattern for the DlgFGrep function.
Parameter defaultFPat
Description A string containing the default filename pattern for the DlgFGrep dialog (the pattern initially displayed). The pattern may contain the standard DOS wildcard characters ? and *. If the pattern contains a path element, the scope of the search is limited to that directory and its subdirectories. If the pattern does not contain a path element, the search covers the current directory and its subdirectories.
FGrepScope returns a string containing the new default pattern. FGrepFile, FGrep, DlgFGrep
FGrepShow display the message file generated by the DlgFGrep function. DlgFGrep
FileTabs=<"extension">, <"tabString">
5HPDUNV
FileTabs creates an association between a filename extension and a tab string. After the association has been made, whenever a file with that extension is loaded into a buffer the associated tab string is used to define tab stops in that buffer.
244
FilterAdd
Parameter extension
tabString
Description A string containing the filename extension to associate with the tab string. When this string is empty, the tab string is applied globally.
A string describing the locations of tab stops in buffers associated with the extension.
Default value when parameter not supplied extension tabString NIL NIL
Tab strings are further described under the Tabs and BufSetTabStr functions. This function is used primarily in the configuration file.
6HH $OVR
5HPDUNV
FilterAdd permits the user to add file filters to those used by the File Open, File Save As, File New Browse, Edit Insert dialog boxes. File filters are the wildcard patterns that appear in the "List file of Type" box that is in the lower left of these dialog boxes.
Parameter desc
Description A string containing a description of the files that match the filter. For example, "C source Files(*.c;*.h)". by convention, the filters are part of this string, placed in parentheses. This string must not be zero length.
A string containing a list of the wildcard patterns that define the files to display, when this filter is selected. Members of this list are separated by semicolons. For example, "*.c;*.h". This string must not be zero length. A number specifying the position within the list of file filters where this filter is placed, with 0 indicating the first position. Numbers larger than the number of members in the list will place the filter at the end of the list.
types
position
245
FilterDeleteList
Default value when parameter not supplied desc types position NIL NIL 0
File filters may be created interactively, through the use of the File Filters dialog. This function is primarily used in the configuration file.
6HH $OVR
FilterDeleteList
FilterDeleteList, FilterGetList
FilterDeleteList deletes the entire list of user-defined file filters. FilterAdd, FilterGetList
5HPDUNV
FontSelectMsg sets a default font for status line messages. Use of this function may require the Microsoft Window SDK.
Parameter fhandle
stockFont
Description The numeric handle of a previously created font. If zero, a stock font may be specified.
Specifies a built-in Windows font. Numeric values for this parameter are predefined in WINDOWS.H. (values 10 to 16)
FontSelectMsg returns TRUE if a font was successfully selected. If not, the function returns FALSE. FontSelectWin, FontCreate, FontQCurrent
Remarks
GotoLine prompts the user, on the status line or in a pop-up window, for the number of the line at which the cursor is to be placed. This function is usually assigned to a key.
246
KeyPlayback
InsertMode=
Remarks
InsertMode toggle the condition of the insert/overtype flag for the current buffer, and prints a message stating which mode is in effect. The message appears on the status line or in a pop-up window. The function is intended for assignment to a key.
ISearch=
Remarks
ISearch performs an incremental search forward from the cursor position in the current buffer. An incremental search is a search in which the program does not wait for the entire search string to be entered. Instead, it searches for a match for what has been typed thus far, after each character is typed. For example, if you type a character "a" it searches forward for the character "a". If next you type "b" it searches forward, including the current position, for "ab". When you find the desired string, or want to cancel the search, just press [Esc]. SrchFind
See Also
KeyPlayback=<"keystring">
Remarks
KeyPlayback plays back the keystrokes recorded in the string supplied as a parameter as if they had been typed from the keyboard.
Parameter keystring
Default value when parameter not supplied keystring The current keystroke recording
The keystrokes represented in the string follow the format described in the "Key Bindings -- Keymaps and Keystrings" section of this manual.
247
KeyRecord
Return Value
KeyPlayback returns one of the following values:
Meaning Successful completion There is nothing to play back. A series of keystrokes is currently being recorded. A recording is currently playing.
KeyRecord=<BOOL overwrite>
Remarks
KeyRecord toggles the recording of keystrokes entered at the keyboard. If keystroke recording is not currently on, it is turned on. Otherwise it is turned off.
Parameter overwrite
Description When the value of this parameter is TRUE, any previous recorded keystrokes will be overwritten. If FALSE, the function will fail instead.
Default value when parameter not supplied overwrite 0 Return Value See Also
KeyRecord returns 0 upon successful completion and 1 if a playback is currently in process. A value of -1 is returned if the function fails. KeyPlayback
KmapAssign=<"keyid">, <"function_call">
Remarks
KmapAssign assigns a function call, including any necessary parameters, to a key combination in the current keymap.
248
LibAutoLoad
Parameter keyid
function_call
Description A string describing the key combination to which the function call is assigned (e.g., "<alt-a>").
A string describing the function call to assign to the key combination (e.g., "MovUp(1)"). If this parameter is NIL the assignment is not made.
Default value when parameter not supplied keyid function_call NIL NIL
The method of representing key combinations in strings is detailed in "Key Bindings -Keymaps and Keystrings" section of this manual. Example: KmapAssign="<Shift-ctrl-UP>","movup 5 "
Return Value
KmapAssign returns TRUE upon successful completion, and FALSE if the assignment cannot be made. Failure is usually due to an invalid keystring, since the function assigned to it is not checked for validity at this time.
LibAutoLoad=<"libNames">
Remarks
LibAutoLoad creates associations between function names and libraries (DLLs) in which they are found when the library has not been loaded into memory. Codewright Professional then knows to load the DLL when the associated function is called. This is not necessary if the library has been loaded in to memory.
Parameter libNames
Description A string containing the name of the DLL, followed by the function names it contains. The details of this string's format and example usage is provided below.
249
LibFunctionReplace
The libNames string begins with the name of the DLL. Note that this is the name only -no path or extension should be specified. The DLL must be in the current directory, or in one of the series of directories named by the CWLIB environment variable. The DLL name may be followed by a colon or left parenthesis to offset it from the names of the functions. This is not required, but is allowed for purposes of readability. Next comes the list of functions. The functions are separated from each other and from the library name by whitespace (spaces or tabs). In addition to the whitespace, which is required, the function names may also be separated by commas. Examples: LibAutoLoad="myDLL: func1 func2 " LibAutoLoad="myDLL func1 func2 " LibAutoLoad="myDLL= func1 func2 )" LibAutoLoad="myDLL= func1, func2 )"
LibPreload
LibFunctionReplace=<"original">, <"replacement">
5HPDUNV
LibFunctionReplace allows limited aliasing or replacement of one function with another. The replacement is limited to execution through the LibFunctionExec function. This includes execution of all keymap assignments and execution through the Command Key. When the original function is called, the designated replacement is executed.
Parameter original
replacement
Default value when parameter not supplied original replacement NIL NIL
250
LibPreLoad
If the function is called directly, through compiled source code, for example, the original function will execute rather than the replacement.
LibFunctionReplace returns TRUE on successful completion and FALSE if both of the arguments is NIL. LibFunctionExec, LibQReplacement
LibPreLoad=<"libName">
Remarks
LibPreLoad loads a dynamic link library (DLL) other than those supplied. supplied DLL's, including the User's DLL, are loaded automatically.
The
Parameter libName
Description The name of the DLL to load. This name may contain a path element, but need not name an extension. If an extension other than .DLL is named, the function will fail.
LibPreLoad returns TRUE when successful, and FALSE upon failure. Failure is usually caused by Codewright Professional being unable to locate the named DLL. LibAutoLoad
251
LibUnLoad
LibUnLoad=<"libName">
Remarks
LibUnLoad releases the memory occupied by the DLL named in the parameter.
Parameter libName
Return Value
This function returns TRUE when successful, and FALSE upon failure. Failure is usually caused by Codewright Professional being unable to locate the named DLL. The function will also fail if a function in the library is being executed (is on the call stack). LibPreLoad, LibAutoLoad
See Also
Lower=
Remarks
Lower forces all alphabetic characters in the current selection to lower case. If no selection has been defined, the current line is converted to lower case.
MarkGoto=<MarkID mark>
Remarks
MarkGoto moves the cursor to the position assigned to the bookmark named as a parameter.
Parameter mark
Description The mark whose location becomes the current cursor position.
252
MarkSet
Return Value
MarkGoto returns 0 upon successful completion and a non-zero value upon failure. For example, failure will result if the specified MarkID is not currently defined.
MarkRestorePos=
Remarks
MarkRestorePos pops the most recently saved cursor position off the stack and makes that position the current position. Cursor positions are saved onto the stack through a call to MarkSavePos. MarkRestorePos returns 0 upon successful completion and a non-zero value upon failure. MarkSavePos
MarkSavePos=
Remarks
MarkSavePos saves the current buffer position described by the parameters in a mark on a stack. This stack is called the "saved positions" stack. The MarkRestorePos function may be used to move to a saved position.
See Also
MarkRestorePos
Remarks
MarkSet assigns the line and column location, specified by the parameters, to the named mark.
Parameter mark
line column
Description The MarkID of the mark to which the assignment is made. This must be a pre-existing mark.
If non-zero, the line number of the current buffer at which the mark is to be set. If zero, place mark in current line. If non-zero, the column number of the current buffer at which the mark is to be set. If zero, use current column number.
253
MenuCmnd
Default value when parameter not supplied mark line column MARK_INVALID 1 1
The reserved mark, mark 0, which is the current cursor position, may be used as a MarkID parameter. This may result in the cursor being moved.
Return Value
MarkSet returns 0 upon successful completion and a non-zero value upon failure.
MenuCmnd=<menuStr>, <itemStr>
Remarks
MenuCmnd allows you to access any menu item directly by specifying strings that match menu and item. This makes it convenient to create your own shortcut keys. It does not work for submenus.
Parameter menuStr
Description A descriptive string indicating which menu to select. For example, the string File would select the File menu. The case of the string is not significant, and you need only specify enough of the menu name to distinguish it from other menus.
A descriptive string indicating which item to select from the menu. For example, the string Open would select the Open item if menuStr selected the File menu. The case of the string is not significant, and you need only specify enough of the item name to distinguish it from other items.
itemStr
Default values when parameters not supplied menuStr itemStr NIL NIL
Here is an example of how this function might be used in a key assignment in your configuration file (CW??.INI): [KmapAssign] ; same as selecting Window | Tile from menu KmapAssign="<F12>", "MenuCmnd w t"
254
MouseLeftDown
MenuCommand=<int menuItemID>
Remarks
MenuCommand allows you to access any menu item directly by specifying its menu item ID number. This makes it possible to create your own shortcut keys.
Parameter menuItemID
Description The numeric ID of the menu item you wish to execute. You can find these IDs in the file EXPORTS.H, in Codewright Professional's INCLUDE subdirectory. They all begin with IDM_ and are grouped together.
MouseLeftDClick=
Remarks
MouseLeftDClick is the function that processes a double click with the left mouse button. Its operation depends upon the context in which the double click was performed. By default, it is used to select a word. MouseRightDClick, MouseLeftDown
See Also
255
MouseRightDown
Remarks
MouseLeftDown is the function that processes a press on the left mouse button. The duration of a press has indicated that it is not a click or a double click. This usually means that the mouse will be dragged to create a selection.
Parameter selType
Description This parameter sets the type of selection that will be created by the function. This parameter may be omitted to indicate a normal selection, as opposed to line or column selection.
When this parameter is TRUE, the selection is limited to a single line. This parameter is usually omitted, in which case the selection is not limited.
oneLine
Default value when parameter not supplied selType oneLine 0 FALSE See Also
MouseRightDown, MouseLeftDClick
Remarks
MouseRightDown is the function that processes a press on the right mouse button. The duration of a press has indicated that it is not a click or a double click. This usually means that the mouse will be dragged to create a column selection.
Parameter selType
Description This parameter sets the type of selection that will be created by the function. This parameter may be omitted to indicate a column selection, as opposed to line or normal selection.
When this parameter is TRUE, the selection is limited to a single line. This parameter is usually omitted, in which case the selection is not limited.
oneLine
Default value when parameter is not supplied selType oneLine SELECTION_COLUMN FALSE See Also
MouseLeftDown, MouseRightClick, MouseRightDClick
256
MovEOF
MovDown=<long lines>
Remarks
MovDown moves the cursor position in line units, usually toward the end of the current buffer.
Parameter lines
Description The number of lines to advance the cursor position in the buffer.
MovDown returns TRUE if the cursor was moved, and FALSE if it did not (for example, the cursor could not advance any further in the direction specified). MovUp
MovEndWin=
Remarks
MovEndWin moves the cursor to the last line visible in the window. The column position does not change, if the current settings allow. This function returns TRUE if the cursor was moved. It returns FALSE if the cursor was already on the last line of the window, or as close as current settings allow. MovTopWin
MovEOF=
257
MovEOL
Remarks
MovEOF moves the cursor position to the last real (non-virtual) line of the current buffer. This function returns TRUE if the cursor position was changed, and FALSE if the cursor position was already within the last line of the buffer. MovEOL
MovEOL=
Remarks
MovEOL repositions the cursor to the position following the last character of the current line. This function returns TRUE if the cursor moved, and FALSE if the cursor was already at the end of the line.
Return Value
MovHome=
MovHome moves the cursor to the beginning of the current line. This function returns TRUE if the cursor was moved, and FALSE if the cursor was already at the beginning of the line. MovEOL
MovLeft=<long columns>
Remarks
MovLeft repositions the cursor toward the beginning of the line by the indicated number of columns.
Parameter columns
258
MovPageDown
The function will not move the cursor past the beginning of the line. if the parameter is a negative number, the cursor is repositioned toward the end to the line. If the cursor cannot be moved the full number of columns indicated, the function moves the cursor to the closest permissible position.
MovLeft returns TRUE if the cursor was moved, and FALSE if it was not (primarily when the cursor is already at the beginning of the line). MovRight
MovNextChar=<long chars>
Remarks
MovNextChar advances the current cursor position by the specified number of characters toward the end of the buffer.
Parameter chars
Description The number of characters to advance the cursor. Negative values for this parameter move the cursor toward the beginning of the buffer.
This function returns TRUE if the cursor was moved, and FALSE if the cursor was already at the buffer extreme. MovPrevChar
MovPageDown=
259
MovPageUp
Remarks
MovPageDown advances the cursor by a "page". displayed in the current window, less one line. A page is the number of lines
The function does not alter the position of the cursor relative to the window, if that position is permissible at the new buffer location.
Return Value
MovPageUp=
This function returns TRUE if the cursor is moved, and FALSE if it was not.
Remarks
MovPageUp moves the cursor toward the beginning of the buffer by a "page". A page is the number of lines displayed in the current window, less one line. The function does not alter the position of the cursor relative to the window, if that position is permissible at the new buffer location.
This function returns TRUE if the cursor is moved, and FALSE if it was not.
MovUp
MovPrevChar=<long chars>
Remarks
MovPrevChar decrements the current cursor position by the specified number of characters, moving it toward the beginning of the buffer.
Parameter chars
Description The number of characters to decrement the cursor. Negative values for this parameter advance the cursor toward the end of the buffer.
260
MovTopWin
Return Value See Also
This function returns TRUE if the cursor was moved, and FALSE if the cursor was already at the buffer extreme. MovNextChar
MovRight=<long columns>
Remarks
MovRight repositions the cursor the specified number of columns to the right of the current position.
Parameter columns
This function returns TRUE if the cursor is moved, and FALSE if it was not.
MovLeft
MovTopBuf=
MovTopBuf repositions the cursor at the first character of the buffer. This function returns TRUE if the cursor is moved, and FALSE if it was already at the top of the buffer.. MovEOF
MovTopWin=
261
MovUp
Remarks
MovTopWin positions the cursor on the first line visible in the window. The column position is not altered by this function, unless the column is not a permissible location within the new line. This function returns TRUE if the cursor is moved, and FALSE if it was not.
MovEndWin
MovUp=<long lines>
Remarks
MovUp moves the cursor position in line units, usually toward the top of the current buffer.
Parameter lines
Description The number of lines for the cursor position to regress in the buffer.
MovUp returns TRUE if the cursor was moved, and FALSE if it did not (for example, the cursor could not advance any further in the direction specified). MovDown
MsgLevel=<int newLevel>
262
MsgMessage
Remarks
MsgLevel sets the message priority level. The purpose of messages ranges from informative to error notification. The function used to display a message indicates its priority. Setting the message level allows you to determine which priority output you will see. Select the appropriate message level from the table below:
Message Origins All messages are displayed. Error and warning messages are displayed. Only errors are displayed. All messages are suppressed Description The number of the message level to assign. A value of -1 for this parameter causes the function to report the current setting only.
MsgMessage=<message>
5HPDUNV
MsgMessage displays the supplied message on Codewright Professional's status line (the bottom of the parent window).
Parameter message
263
MsgPauseOnError
The color of this message may be set using the function ColorMessage. When the Message Level is greater than 0 (MsgLevel), messages that would otherwise be displayed are suppressed.
6HH $OVR
MsgPauseOnError=<BOOL setting>
Remarks
MsgPauseOnError prescribes whether Codewright Professional should pause between multiple warning or error messages.
Parameter setting
Description This value is TRUE to turn pausing on, and FALSE to turn pausing off.
Return Value
NextWord=
Remarks
NextWord moves the cursor position to the first non-whitespace character immediately following the next space, tab or newline. PrevWord, SrchFind
See Also
OutputFile=
264
Paste
Remarks
OutputFile prompts the user to enter an output filename for the current buffer. This is the file to which the buffer will be written upon the next save.
OutputWindow=<int showMode>
Remarks
OutputWindow lets you display or hide the tabbed output window, or specify which tab is selected.
Parameter showMode
Description This parameter specifies whether the window is showing and which tab is selected, if it is showing. Values of 0 or greater represent the offset of the tab from the left side of the window. 0 represents the first tab, 1 represents the second and so on. Specifying a tab to select makes the output window visible.
Values less than 0 receive special treatment as indicated below:
Value -1 -2
-3
Purpose Query current visibility status. Display output window without changing which tab is selected. Hide output window
Return Value
Paste=
OutputWindow returns a BOOL indicating TRUE if the window is visible and FALSE if it is hidden.
Remarks
Paste inserts the contents of the Scrap buffer or Windows Clipboard, depending upon which is enabled, at the current cursor position. An informative message is printed on the status line. This function is intended for assignment to a key.
265
PrevWord
PrevWord=
Remarks
PrevWord moves the cursor position to the first non-whitespace character immediately following the previous space, tab or newline. NextWord, SrchFind
See Also
Print=<BOOL direct>
Remarks
Print prints the contents of the current buffer on the default printer device.
Parameter direct
Description If this parameter is TRUE, printing occurs without further input, using the current settings. If this parameter is FALSE, the Print dialog box is invoked to allow reviewing and modifying the settings prior to printing.
Default value when parameter not supplied direct hWndParent FALSE 0 Return Value See Also
Print returns TRUE when the printing is successfully commenced. It returns FALSE if the print job was cancelled. PrintSelection
PrintFlags=<WORD flags>
Remarks
PrintFlags sets the flags associated with the File Print dialog (Print) that control various option settings.
Parameter flags
Description A value whose bit settings determine various attributes of the Print task. The bits and their meanings are as follows: Purpose
Bit
266
PrintFooter
PRN_SELECTION PRN_LHEADER PRN_CHEADER PRN_RHEADER PRN_LFOOTER PRN_CFOOTER PRN_RFOOTER PRN_CHROMACODING PRN_CC_ITALIC PRN_CC_BOLD PRN_CC_SWITCH PRN_NO_FF
Print only the contents of the current selection. Left justify the header. Center the header. Right justify the header. Left justify the footer. Center the footer. Right justify the footer. Use ChromaCoding in printing. Use italic text for ChromaCoding. Use bold text for ChromaCoding. Make ChromaCode use plain text and give ChromaCode attributes to other text. Treat form feed as just another character.
Default value when parameter not supplied flags 0 Return Value See Also
PrintFlags does not return a value.
PrintFooter=<"footer">
Remarks
Parameter footer
Description A string containing the footer string to print on each page printed. This string may contain any of several macros which are defined as follows: Macro %f %d %p Expands to Current filename Today's date Current page number
267
PrintHeader
Default value when parameter not supplied footer NIL Return Value See Also
PrintFooter does not return a value.
PrintHeader, PrintFlags
PrintHeader=<"header">
Remarks
Parameter header
Description A string containing the footer string to print on each page printed. This string may contain any of several macros which are defined as follows: Macro %f %d %p Expands to Current filename Today's date Current page number
Default value when parameter not supplied header NIL Return Value See Also
PrintHeader does not return a value.
PrintLineInc=<WORD inc>
5HPDUNV
268
PrintMargin...
Parameter inc Description A value that determines the interval between line numbers on a printout. A value of 0 for this parameter turns line numbering off. A value of 1 prints the line number on each line. The default value is 5, which means that line numbers are printed on every fifth line.
PrintLineInc=<WORD inc>
Remarks
Parameter inc
Description A value that determines the interval between line numbers on a printout. A value of 0 for this parameter turns line numbering off. A value of 1 prints the line number on each line. The default value is 5, which means that line numbers are printed on every fifth line.
Default value when parameter not supplied inc 0 Return Value See Also
PrintLineInc does not return a value.
Print, PrintFlags
PrintMargin...
269
PrintSelection
PrintMarginBottom=<WORD margin> PrintMarginLeft=<WORD margin> PrintMarginRight=<WORD margin> PrintMarginTop=<WORD margin>
5HPDUNV
The PrintMargin... functions define how many lines or columns are reserved as a margin at the top, bottom, left and right edge of the page.
Parameter margin
Description The number of lines (top or bottom) or columns (left or right) to reserve as a margin. Lines that do not fit between the margins are truncated.
6HH $OVR
PrintSelection=
Print, PrintFlags
Remarks
PrintSelection prints the contents of the current selection on the default printer device. Unlike most functions that operate on selections, this function does not remove the selection upon completion. If a selection is marked, PrintSelection sends it to Windows for printing and returns TRUE. If no selection is marked, the function returns FALSE and nothing is printed. Print errors are handled by Windows. Print
Return Value
See Also
QDefaultKeymap=
Remarks
270
ScrapPrev
Return Value
QDefaultKeymap returns a string containing the name of the keymap, e.g., "CUA" or "brief". DefaultKeymap
See Also
Redo=
Remarks
Redo undoes the undo immediately preceding. It prints a message indicating that the undo has been redone, or prints "nothing to redo" if there was no undo operation immediately preceding. This function is intended for assignment to a key. Undo
See Also
Repeat=
Remarks
Repeat is an interactive function intended for assignment to a key. It first prompts for the number of times that you wish to repeat a command, and then waits for the command. That command is repeated the specified number of times.
ResizeWindow=
Remarks
ResizeWindow allows the user to interactively resize the current window. This function is the same as selecting "Size" from the window's System menu.
ScrapNext=
ScrapNext selects the next scrap buffer in the circular list of scrap buffers. ScrapNext returns the index of the previously current scrap buffer.
ScrapPrev
ScrapPrev=
271
ScrapSetCount
Remarks Return Value See Also
ScrapPrev selects the previous scrap buffer in the circular list of scrap buffers. ScrapPrev returns the index of the previously current scrap buffer.
ScrapNext
ScrapSetCount=<WORD count>
5HPDUNV
Parameter count
5HWXUQ 9DOXH
SelectWord=
ScrapSetCount returns the new setting for the number of scrap buffers that exist.
Remarks
SelectWord creates a selection around the word in which the cursor is positioned. If the cursor is located in whitespace no selection is created. This function is normally assigned to the mouse Left-Double-Click action. SelectWord returns TRUE is a selection was created and FALSE if not.
NextWord, PrevWord
SetLineDrawBindings=
272
SetLineDrawStyle
Remarks
SetLineDrawBindings makes the key assignments for line drawing with the arrow keys. Assignments are made to the up, down, left and right keys that allow them to be used for drawing lines in documents when the ) and + keys are also depressed. This function is only available when the "add-on" CWLDRAW.DLL has been loaded. This can be done by adding a line to your .INI file under the [LibPreload] section. Add the statement LibPreload=CWLDRAW.DLL. The characters inserted by the Line Draw keys will only appear as lines if a font supporting the IBM OEM character set is used. The functions that perform the actual drawing are as follows: LDUp, LDDown, LDRight, and LDLeft. These functions are not documented elsewhere.
SetLineDrawStyle
SetLineDrawStyle=<WORD style>
Remarks
SetLineDrawStyle sets the types of lines used by the Line Draw functions.
Parameter style
Description A value from 1 to 4 indicating which style of lines to use. If a style is not specified, style 1 will be used.
Return Value
SetLineDrawStyle returns the style number that has been put into effect.
273
SlideIn
See Also
SetLineDrawBindings
SlideIn=<"ch ">
Remarks
Parameter ch
Description The string to use for indenting. This parameter usually specifies a space or a tab, but may also specify a comment character, such as ";", "#" or "C" or decorative character such as "*". If this is a NULL no action is taken.
SlideOut=<"ch ">
Remarks
Parameter ch
Description The string by which the line or block is outdented. If this is a NULL no action is taken.
If the string specified is whitespace (space or tab), and the line is prefixed with whitespace, the parameter is treated as an increment rather than a literal character. For example, if the line begins with a tab and a space is the parameter, the whitespace is adjusted to outdent it one column. Similarly, if the line is preceded by spaces and a tab is specified, the line is outdented the equivalent number of spaces. Other strings are treated literally, such as ";" which removes only semicolons, when present at the beginning of the line. If the
274
SrchFind
specified string is not present at the beginning of the line, no action is taken for that line.
Space=
Remarks
Space is intended to be bound to the space key. If there is no current selection, this function merely inserts a space character into the buffer. If there is a selection defined, the function indents that selection by a single space. SlideIn
See Also
Remarks
SrchFind searches for text that matches the supplied string or regular expression pattern.
Parameter sPattern
sFlags
Default value when parameter not supplied sPattern sFlags NIL SrchQFlags
When a match is found, the cursor is positioned at the beginning of the matched text, unless a regular expression pattern is used which dictates otherwise.
Return Value
SrchFind returns TRUE if a match was found, and FALSE if no match was found.
275
SrchQFlags
See Also
SrchQFlags
SrchQFlags=
Remarks
SrchQFlags reports the value of the search attribute word. There are functions for setting each of the individual attributes. These attributes include: case-sensitivity, direction and scope of the search, and whether patterns are treated as regular expressions or as ordinary strings. This provides a method of obtaining a snapshot of the search attribute settings at any particular time. That state can later be restored by supplying the value obtained from this function to the SrchSetFlags function.
SrchQFlags returns the search attribute word currently in effect. The meaning of the individual bits of this value are listed in the description of the SrchSetFlags function. SrchSetFlags
SrchSetFlags=<DWORD sFlags>
Remarks
Parameter sFlags
Description The value to which the search attribute word is set. A value of -1 for this parameter causes the function to report the current setting only.
276
SrchTranslate
Label
SEARCH_IGCASE SEARCH_MAXIMAL SEARCH_REGEX
Purpose
Turns case-sensitivity on or off. When the bit is off, case is significant in matching. When on, it is not. When regular expressions are in use, this indicates whether the search will match the largest unit of text or the smallest that fits the specified pattern. Determines whether the pattern to match is treated as a regular expression or an ordinary string. When the bit is on, it is treated as a regular expression. When off, it is treated as an ordinary string. Determines the direction the search takes, relative to the cursor position. When the bit is on, the search begins with text subsequent to the cursor. When off, the search begins with text preceding the cursor. Determines if search operations and replace operations are limited to the current selection . When the bit is on, the operation is limited to the selection. When off, the operation is not limited. Determines if operations terminate after reaching a buffer extreme (beginning or end). When the bit is on, the operation continues from the opposite extreme to the point at which the operation began. When off, the operation is discontinued when a buffer extreme is reached. Used only during replace operations. When the bit is on, all matches within the scope of the operation are subject to translation. When off, the operation only applies to the first match found. Used only during replace operations. When the bit is on, replace operations prompt before changing text matching the pattern. When off, text is replaced without prompting. Used only during replace operations. When this bit is on, one occurrence is replaced without prompting and then the function returns. Used in regular expression searches, primarily for BRIEF compatibility. Forces the Alternation operator, |, to have a lower precedence than other operators.
SEARCH_FORWARD
SEARCH_SELECTION
SEARCH_WRAP
SEARCH_GLOBAL
SEARCH_PROMPT
SrchQFlags
277
StateSetMarkLevel
Remarks
SrchTranslate searches for text that matches a string or regular expression pattern. If a match is found, the text is replaced with a supplied string, with permission.
Parameter sPattern
rString sFlags
Default value when parameter not supplied sPattern rString sFlags NIL NIL SrchQFlags
rLen NIL
The cursor is positioned at the beginning of the matching text when prompting for replacement. The cursor returns to its original position at the end of multiple replacements, if allowed to run to completion. If aborted by the user, the cursor is left at the last occurrence of matching text.
StateSetMarkLevel=<int LevelFlags>
Remarks
StateSetMarkLevel defines what kinds of bookmarks will be recorded in the statefile for restoration.
Parameter LevelFlags
Description A value whose bits determine which types of marks are saved in the Codewright Professional state file. A -1 for this value indicates that it is a query only, and the setting is not changed. A value of 0 turns off mark saving, while a value of 0x000f turns on saving for all types of marks. The labels below have been defined to assist you in defining the proper flags value.
278
SysCaretHeight
Default values when called from LibFunctionExec (Command Key) fname 0
Label
SAVE_MARK_LOCAL SAVE_MARK_GLOBAL SAVE_MARK_POS SAVE_MARK_SEL
Description Save local bookmarks in the state file for restoration. Save global bookmarks in the state file for restoration. Save the Saved Position stack in the state file for restoration. Save the current selection in the state file for restoration.
Return Value
SysBeep=
Remarks
Remarks
SysCaretHeight sets the height of the caret or cursor for one of four cursors used by Codewright Professional.
Parameter percent
Description The height or the cursor as a percentage of the character cell height. Positive values fill from the top of the cell, while negative values fill from the bottom.
An index, specifying which of the four cursors is being defined. The predefined labels for this purpose are as follows:
cursor
279
SysCaretWidth
Label
CARET_INSERT CARET_INSERT_VIRTUAL CARET_OVERTYPE CARET_OVERTYPE_VIRTUAL
Description
Cursor used in insert mode, when the cursor is in the text area. Cursor used in insert mode, when the cursor is in virtual space. Cursor used in overtype mode, when the cursor is in the text area. Cursor used in overtype mode, when the cursor is in virtual space.
SysCaretHeight returns the previously defined caret height. If a cursor other than the four above is specified, the function returns 0. SysCaretWidth
SysCaretWidth=<int percent>
Remarks
SysCaretWidth sets the width for the cursors used by Codewright Professional.
Parameter percent
Description The width or the cursor as a percentage of the character cell width. Fill begins at the left of the cell.
SysCaretWidth returns the width of the caret that was previously in effect.
SysCaretHeight
SysExit=<int exitcode>
Remarks
SysExit terminates Codewright without performing any cleanup, such as saving buffers to output files and deleting temporary files.
Parameter exitcode
Description The termination code returned to the operating system upon exit.
280
SysQFlags
SysQFlags=
Remarks
SysQFlags reports the state of various system-wide attributes. These settings may also be changed through the menu system and dialogs. This function returns a value that describes the status of various system-wide attributes. Each attribute is represented as a bit within this value. To facilitate analysis of this value, a number of labels have been defined, representing the values of the respective bits. These labels and a description of each are provided below:
Return Value
Bit Label
SYSFLAG_AUTOSAVE_ENABLED SYSFLAG_CLIPBOARD SYSFLAG_CMND_LINE_PROMPT SYSFLAG_CONFIG_UPDATE SYSFLAG_HIDE_BUTTON_MSGS SYSFLAG_HIDE_CURSOR SYSFLAG_IBEAM_CURSOR SYSFLAG_RETAIN_DIR
SYSFLAG_SHOW_TOOLBOX SYSFLAG_TRAP_SYS_KEYS
SYSFLAG_UNDO_PAST_SAVE
All of these bits are read-write and may be set with the SysSetFlags function.
281
SysSetCwd
See Also
SysSetFlags
SysSetCwd=<"cwd">
Remarks
SysSetCwd sets a new working directory for Codewright Professional. This directory becomes the default for various dialog boxes. It does not affect Windows or other applications running concurrently.
Parameter cwd
Description A string, naming the directory that is to be made current. The string may indicate a new drive as well as directory, and the path may be relative. Either forward or backward slashes may be used to separate elements of the path.
Default value when parameter not supplied cwd NIL Return Value
SysSetCwd returns TRUE if the specified directory was successfully made the default. If the directory or path does not exist, the function returns FALSE.
Remarks
SysSetDefault allows changing the default settings for newly created buffers and edit windows. These defaults are stored in the model window and model buffer. Therefore, changing the settings of the current window or buffer does not affect them.
Parameter defaultIndex
Description A value indicating which feature's setting to modify. A series of labels have been defined for specifying which feature the request pertains to. These labels correspond to features of the current window or buffer. The labels are listed below:
282
SysSetFlags
Label
DEFAULT_BUFFER_AUTOINDENT_MODE DEFAULT_BUFFER_BACKUP_SPEC DEFAULT_BUFFER_MAX_TAB DEFAULT_BUFFER_MAX_VLINES DEFAULT_BUFFER_SYSFLAGS DEFAULT_BUFFER_TABS DEFAULT_COLOR_COMENTS DEFAULT_COLOR_DIFF_ADD_LINES DEFAULT_COLOR_DIFF_DEL_LINES DEFAULT_COLOR_INS_LINES DEFAULT_COLOR_KEYWORDS DEFAULT_COLOR_LINENUMBERS DEFAULT_COLOR_MOD_LINES DEFAULT_COLOR_SELECTION DEFAULT_COLOR_TEXT DEFAULT_WINDOW_FONT DEFAULT_WINDOW_HINC DEFAULT_WINDOW_KEYMAP DEFAULT_WINDOW_LEFT_MARGIN DEFAULT_WINDOW_SYSFLAGS DEFAULT_WINDOW_USERFLAGS DEFAULT_WINDOW_VIS_ELISION DEFAULT_WINDOW_VIS_EOF DEFAULT_WINDOW_VIS_EOL DEFAULT_WINDOW_VIS_MARGIN_COL DEFAULT_WINDOW_VIS_SPACES DEFAULT_WINDOW_VIS_TABS DEFAULT_WINDOW_VIS_VIRTLINES DEFAULT_WINDOW_VIS_VIRTSPACES
setting
This parameter may be either a numeric value or a string, depending on which default is being set.
SysSetFlags=<DWORD flags>
Remarks
Parameter flags
283
SysSwapBlocks
The predefined labels for this flag and their meaning are given below:
Bit Label
SYSFLAG_AUTOSAVE_ENABLED SYSFLAG_CLIPBOARD SYSFLAG_CMND_LINE_PROMPT SYSFLAG_CONFIG_UPDATE SYSFLAG_HIDE_BUTTON_MSGS SYSFLAG_HIDE_CURSOR SYSFLAG_IBEAM_CURSOR SYSFLAG_RETAIN_DIR
SYSFLAG_SHOW_TOOLBOX SYSFLAG_TRAP_SYS_KEYS
SYSFLAG_UNDO_PAST_SAVE
SysQFlags
SysSwapBlocks=<int lockedBlocks>
284
Tabs
Remarks
SysSwapBlocks allows you to increase or decrease the number of memory blocks reserved by Codewright Professional. When Codewright Professional needs more memory than it has reserved, it swaps some blocks to disk. If Codewright Professional seems to be swapping to disk too much, and more memory is available, you can improve performance by increasing the number of reserved memory blocks. The initial default is 20 blocks.
Parameter lockedBlocks
Description The number of 8K blocks to reserve (lock) for use by Codewright Professional.
Tab=
Remarks
Tab is the function normally assigned to the tab key. It not only inserts the tab character on request, it also indents when a selection is defined. BackTab
See Also
Remarks
Tabs defines a new tab string for the current buffer. The tab string describes where tab stops occur by listing the column numbers at which tab stops are to be placed.
Parameter tabString
Description A string containing a list of column numbers at which tab stops are placed. These column numbers are separated by spaces. If this parameter is omitted, the function prompts for the tab string. If the tab string is invalid (e.g., does not begin with a number), the default value of "9 17" is used.
285
TagFind
Normally, all but the first one or two tab stops are implicit, rather than at explicitly named columns. The interval between the last two explicit tab stops is repeated to the maximum column allowed for tab stops, thus creating numerous implicit tab stops. If a single tab stop is listed, the interval between that tab stop and the beginning of the line is repeated.
TagFind=<"label ">
Remarks
TagFind looks for the specified label in the "tags" data file. If the data file indicates in what file and at what line the label is defined, that file is loaded and the position displayed.
Parameter label
Description A string containing the label to search for in the tags data file. If this parameter is NIL the function uses the word at the cursor position.
Return Value
TagFind returns TRUE if the tag definition was found in the data file. It returns FALSE, otherwise. TagSetFile, TagIgnoreCase, TagPrompt
See Also
Remarks
TagIgnoreCase indicates whether case is significant when searching for a label in a Tags data file. This function is usually used in connection with Tags file setup.
286
TagSetFile
Parameter igcase Description If this parameter is TRUE case will not be treated as significant. If FALSE, case is significant.
Default value when parameter not supplied igcase (current state is toggled)
This function affects the searches performed by the functions TagFind and TagPrompt. It is usually used in conjunction with specifying the name of a data file, to match the method in which tag definitions are stored in that file.
Return Value
TagIgnoreCase returns the resulting state of this feature: TRUE when case is ignored, FALSE when case is significant. TagPrompt, TagFind
See Also
TagPrompt=
Remarks
TagPrompt prompts the user for a label to search for in the Tags data file. If the data file indicates in what file and at what line the label is defined, that file is loaded and the position displayed. Some setup is required for this function to work. Primarily, the name of the tags data file must be defined with the TagSetFile function. TagPrompt works with CTags other Tags data files using the standard Tags format. Codewright Professional does not maintain the Tags database automatically. This job must be periodically performed by an external process.
Return Value
TagPrompt returns TRUE if the tag definition was found in the data file. It returns FALSE, otherwise. TagFind, TagSetFile
See Also
TagSetFile=<"fname ">
287
ToBottom
Remarks
TagSetFile sets the name and directory of the Tags data file used in Tags searches.
Parameter fname
Description A string containing the path and complete filename of the file containing the Tags definitions. This file must conform to the standard Tags file format.
Return Value
TagSetFile returns TRUE if the filename is found to be in valid format. If the filename specified is not a valid DOS path or filename, the function returns FALSE. TagFind, TagIgnoreCase, TagPrompt
See Also
ToBottom=
Remarks
ToBottom scrolls the current line of the buffer to the bottom of the window. The cursor position is not altered, relative to the text. ToTop
See Also
ToTop=
Remarks
ToTop scrolls the current line to the top of the window. The cursor position is not altered, relative to the text. ToBottom
See Also
Undo=
288
WinScrollHInc
Remarks
Undo reverses the effects of the most recent edit operation or cursor motion. It prints a message indicating that the edit has been undone, or prints "nothing to undo" if there are no further undos available. This function is intended for assignment to a key. Redo
See Also
Upper=
Remarks
Upper converts all of the characters in the current selection to upper case. selection is defined, the function converts the entire line to upper case. Lower
If no
See Also
Visibles=<int on >
Remarks
Visibles turns on, off or toggles the display of special characters in place of otherwise invisible portions of the buffer. Such things as the end of file, end of line, spaces, tabs, and virtual space normally appear as undifferentiated blank space in a window. This function assigns more visible representations to these items. For example, a paragraph symbol is used for end of line, and a dot for a space.
Parameter on
Description When non-zero, this parameter turns on the use of the visible representations. When zero, it turns their use off. If the parameter is omitted, the feature is toggle to the opposite of its current condition.
See Also
WinVisible...
WinScrollHInc=<long unit>
Remarks
WinScrollHInc defines the number of columns that Codewright Professional scrolls left or right when scrolling is required.
289
WinSetCreationPos
Parameter unit Description The number of columns to shift the view each time horizontal scrolling is needed. Negative values for this parameter cause the function to report the current setting without changing it.
Return Value
This function returns the new horizontal scroll incremental unit. If the parameter is a negative value, the function merely returns the current setting.
Remarks
Parameter X, Y
Description The coordinates, relative to the Upper lefthand corner of the client area, at which the Upper lefthand corner of the window is placed.
The label CW_USEDEFAULT may be used for either or both of these parameters, in which case a random value for that parameter is chosen by Windows each time a window is created.
width, height
The extents in each dimension of the window. The label CW_USEDEFAULT may be used for either or both of these parameters, in which case a random value for that parameter is chosen by Windows each time a window is created.
height
CW_USEDEFAULT
Return Value
290
WinVisible...
WinVisible...
WinVisibleEOF=<int symbolic> WinVisibleEOL=<int symbolic> WinVisibleSeparator=<int symbolic> WinVisibleSpaces=<int symbolic> WinVisibleTabs=<int symbolic> WinVisibleVirtLines=<int symbolic> WinVisibleVirtSpaces=<int symbolic>
Remarks
The WinVisible... functions allow you to specify printable characters to represent various characters that are not otherwise visible. These functions effect only the appearance in the current window. The contents of the buffer is not effected.
Parameter symbolic
Description The character which is to symbolize the non-printing character. A value of -1 for this parameter causes the function to report the current setting only.
291
WinVisibleMarginColumn
Return Value See Also
These functions return the character that was the previous setting.
Visibles, SysSetDefault
WinVisibleMarginColumn=<int column>
Remarks
WinVisibleMarginColumn draws a vertical line at a specified column, within the current window. The line does not affect editing in any way, but can serve as a reminder for those who must adhere to a line length standard.
Parameter column
Description The column number at which the margin line is to appear. A zero value disables this feature. A value of -1 for this parameter causes the function to report the current setting, but not to change it.
WrapEnable=<int state>
Remarks
WrapEnable selects one of three states for the Word Wrap feature.
Parameter state
Description When this parameter is 0, the Word Wrap feature is turned off. When a value of 1 is supplied, Word Wrap is enabled, but it only wraps the current line. If typing into an existing paragraph, one or more subsequent lines may require reformatting. When this parameter is 2, the current line and all lines following in the paragraph are wrapped.
A series of labels has been defined for use with this function:
Label
WRAP_DISABLED
Value 0
292
WrapSetRightMargin
WRAP_ENABLED WRAP_CONTINUOUS
l 2
WrapEnable returns the new state for the Word Wrap feature.
WrapParagraph=
Remarks
WrapParagraph formats the paragraph in which the cursor is placed to conform with left and right margins. A paragraph is defined as one or more lines of text surrounded by blank lines. This feature relies on Auto-indent to maintain the whitespace margin you create on the left. It therefore turns Auto-indent on or off as necessary. The right margin is defined by the function WrapSetRightMargin, the Right Margin Mark, or the right edge of the window.
See Also
WrapSetRightMargin=<long margin>
Remarks
WrapSetRightMargin sets the right-hand column after which text will wrap to the next line, when the Word Wrap feature is enabled.
293
WriteBuffer
Parameter margin Description The column number that is the maximum width for text on a line when Word Wrap is on. A value of 0 for this parameter tells Word Wrap to use either the Right Margin Mark or the edge of the window as the right margin.
WriteBuffer=
Remarks
WriteBuffer writes the currently defined selection, or the entire buffer to disk. If a selection is defined, the function prompts for a filename to which to write the contents of the selection. If no selection is defined, the function saves the entire buffer to its output file, if the buffer contains changes that have not been saved. The function prints a message indicating whether the operation was successful. BufWrite, BufWriteSelection
See Also
ZoomWindow=
Remarks
ZoomWindow zooms in or out on the current edit window, depending on its setting at the time. If the window is maximized, the window is returned to its normal state. If the window is in its normal state, it becomes maximized.
294
System Overview
The first step in changing Codewright is to understand its anatomy. You can then move from the general to the more specific, in locating the part of Codewright that you want to concentrate on. The primary executable, CW.EXE or CW32.EXE, contains the Codewright Application Programming Interface (API). These are the functions and capabilities that are basic to Codewright's operation. Although you cannot rewrite the functions in the API, you can replace them, in a limited fashion. We will discuss function replacement later. The point is, the source code for main executable is not supplied. External to the primary executable are several Dynamically Linked Libraries (DLLs) which provide services in several areas: Core services. Supplemental language support. Keyboard command sets.
Core Services
Auxiliary services.
Core Services
The core services are those that Codewright always expects to have available. Some of these services are so essential that Codewright is unable to properly initialize without them. For example, you could use Codewright if no keyboard command sets were available -- you could even build or find a keyboard command set. If the core services were missing, however, the keyboard commands would be of no use.
CWSTART DLL
The CWstart DLL is named CWSTART.DLL. It performs numerous initialization tasks, such as loading other DLLs and reading the configuration file. The source code to CWSTART.DLL is provided. Many of the extension functions are defined in this DLL. To utilize them in your own
296
Core Services
source code you will need to include the header file CWSTART.H, which is in Codewright's CWSTART subdirectory. The tree diagram and file descriptions below will help you locate the functions provided in the various source files.
AUTOSAVE.C COMPILE.C CONFIG.C CWSTART.C DLGMENU.C FILTER.C OUTPUT.C STATE.C UTIL.C VCS.C WWRAP.C
ERRORFIX.C ERRINFO.C
* Support for additional languages, such as Paradox and dBASE/Clipper, are contained in separate DLLs. These DLLs are Language Supplements, and their use is optional. See the "Supplemental Language Support" section below for a more complete description.
Language Features File LANGUAGE.C Description The file that contains the engine for language specific features, such as ChromaCoding, Template Expansion, and Language Indenting. It relies on a series of functions being defined elsewhere that incorporate the corresponding filename extension into the function name (e.g., _c_indent(), _pas_indent() ). This file contains the functions that support language specific features for assembly language source files (.ASM files). This file contains the functions that support language specific features for C language source files (.C files).
ASM.C C.C
297
Core Services
CPP.C PAS.C This file contains the functions that support language specific features for C++ language source files (.CPP files). This file contains the functions that support language specific features for Pascal language source files (.PAS files).
Description Contains the functions in support of the Auto-save feature. Contains the functions for the Compile, Make, and Rebuild selections on the Project menu. Contains the functions that read, write and process the configuration file. The functions in this file initialize the CWSTART DLL. Contains the supporting functions for the Popup Menu defined by CWRIGHT.MNU. Contains the functions that support the Filter selection on the Project menu. Contains the supporting functions for the tabbed Output Window. Contains the functions that read, write and process the state file. Contains functions used by one or more of the keymaps and other shared functions, such as NextWord /PrevWord. Contains the functions supporting the Version Control submenu. Contains the function in support of the Word Wrap and related features. Error Parsing
File ERRORFIX.C
ERRINFO.C
Description This file contains the engine that drives the various error parsers for different compilers and languages. This file contains the actual error parsers for the various compilers. Macros
File BRACE.C
CURSOR.C ENTAB.C PREPROC.C PROMPT.C
Description The source code file for the Codewright brace matching features, including the functions Brace, BraceMatch and BraceMatchNext. This file contains functions to make and support mouse assignments and operations. The functions that support entabbing and detabbing the current buffer are contained in this file. Contains the functions in support of the Preprocess function. This source file contains the prompting functions and supporting functions that use the prompt history facility.
298
CWDIALOG DLL
The CWdialog DLL is one of the DLLs that is loaded during initialization. The name of this file is CWDIALOG.DLL. This library contains the dialog functions that support the menuing and other interactive operations. The source code for the CWdialog DLL is also supplied. There are a number of functions in this DLL that allow you to access the dialogs on the menu directly. It is sometimes useful to assign these functions directly to keys, or to call them from your own source code. These functions are the functions beginning with Dlg... and Print. To use these functions, just include the file CWDIALOG.H into your C source code. You will find this file in Codewright's CWDIALOG subdirectory.
CWHELP DLL
The CWhelp DLL contains the functions that access the various Help libraries used by Codewright. These include the contextual help for the editor, the Codewright API function help, and the Microsoft Windows API (SDK) help, if you have it. The name of the DLL is CWHELP.DLL. If you want to call the function cwhelp from your C source code, you will need to include the file CWHELP.H in your file. This header file is located in Codewright's CWHELP subdirectory.
299
DLL PRG.DLL
SC.DLL COB.DLL BAS.DLL CWHTML.DLL CWJAVA
Description This DLL contains the functions that support language specific features for dBASE and Clipper language source files (.PRG files). This DLL contains the functions that support language specific features for Paradox PAL source files (.SC files). This DLL contains the functions that support language specific features for COBOL source files (.COB files). This DLL contains the functions that support language specific features for Visual Basic for Windows (.BAS files). This DLL contains additional support for the HTML language, including a split window viewer. This DLL contains the functions that support language specific features for JAVA source files.
These DLLs are not automatically loaded, as is CWSTART.DLL. You will need to use the Libraries dialog on the Tools menu. It adds a statement to your Codewright configuration file (CWRIGHT.INI). Here are example load statements for these DLLs:
300
Auxiliary Services
[LibPreload] LibPreload=PRG.DLL LibPreload=SC.DLL LibPreload=COB.DLL LibPreload=BAS.DLL The statements above load the DLLs and make the functions in them immediately available for use. This does have the effect of slowing the initial loading of Codewright. An alternative is to use LibAutoLoad rather than LibPreload. This will cause the DLLs to be loaded only on demand. It does, however, require listing all of the function in the DLL in the statement. See the description of this function for details.
Auxiliary Services
The Auxiliary Services or DLLs provide support for supplemental features. These features or groups of features are generally provided in separate DLLs. The source code for each DLL, if provided, is in a subdirectory within Codewright's home directory. Each subdirectory is given a name that is the same as the root name of the DLL. These Features or DLLs are add-on packages that may not be required by every user. Like the additional language support DLLs, they may require a little setup to use. They are generally not loaded automatically.
DLL CWLDRAW.DLL
CWREDIT.DLL
CWDIFF.DLL
CWFOPEN.DLL CWDDE.DLL
CWBROWSE.DLL
Description This DLL allows remapping the keyboard so that you can draw lines and boxes in your file, using the IBM OEM character set. You must be using OEMfixed, 8514oem, terminal, or similar font. If not, these lines will be displayed as international characters. It is not loaded automatically. This DLL provides the user with the ability to edit the Tool Ribbon and SideBar interactively. It supports the Tools/Toolbars Editor menu selection. This DLL contains the support for Codewright's differencing feature. It allows side-by-side differencing of files or buffers, in addition to single buffer difference analysis. This DLL supports the File Open mode of the Codewright SideBar. This DLL contains the functions that turn Codewright into a DDE server. Other applications can then operate Codewright remotely to perform syntax checking, Lint, and Tags database updating. The DLL is not loaded automatically. This DLL contains the main support for Codewright's Browser. This DLL is loaded automatically, when needed.
301
Sample DLL
The source code for an essentially empty DLL has been included. You will find it in the SAMPLE subdirectory in the Codewright home directory. You can put some flesh on this skeleton, or you may use it as an example of what elements go in to a Codewright DLL. The source code for SAMPLE.DLL is a skeleton of comments and function stub or two. The comments show you where to insert additions or changes that you want to make to Codewright. These insertions might include: Loading other DLLs, possibly written in a programming language other than C. Adding event handlers. Setting defaults, much as you would in the configuration file. Adding key commands. Writing and installing replacement functions.
302
Exporting Functions
The functions in a DLL, and the parameters for each, must be registered with Codewright before you can make full use of them. If you don't register them with Codewright, you will not be able to assign them to a key or call them from the API Command Key. You register or export the functions with the LibExport function. This is in addition to any export declarations required by the programming language. This requirement is a result of the use of Pascal calling conventions. When using Pascal calling conventions, the program stack would become unbalanced if any function parameters were omitted. Yet, the function LibFunctionExec, which services the API Key and the key assignments, has no way of knowing the type and number of parameters are required unless you tell it. The LibExport function does this. Note: If you change the number or type of parameters in a DLL function, you must remember to change the corresponding LibExport call that registers that function.
303
304
Flag Initialization
One of the first things you will want to do in your keymap function is to set options the way users of your keymap will expect to find them. For example, the Brief keymap needs to allow assignments to Alt keys, and doesn't create a new window for each new file that is loaded. If the users of your keymap will expect to have vertical and horizontal scroll bars on their edit windows, now is the time to make that happen. There are several functions that will assist you in setting the options you require. They are: SysSetFlags, SysSetDefault, and SrchSetFlags. Use SysSetFlags to set options you might otherwise set from the System Options dialog. To set up window and buffer settings the way you want, even before any buffers or windows have been created, use SysSetDefault. To set the default search settings, use SrchSetFlags. You will find these functions described further in the second part of this manual. You are not dictating with these settings how a user must operate. The settings you create here may be overridden by settings stored in the configuration file or state file.
Basic Assignments
When you create a new keymap, it is empty -- and we mean really empty. The only keys or mouse actions that will work are those that Codewright lets Windows process. This includes menus, +7, +;, + and such. If you want pressing the A key to produce and A in a buffer, you need to make that key assignment. There are functions provided to take the drudgery out of making these assignments. KmapAssignTypables and KmapAssignRange are your primary assistants. The difference between these two functions is that the first makes assumptions about what you want the keys to do, whereas the second allows you to specify the function that is assigned to the keys.
305
Recompiling a DLL
Keymap Specific Assignments
Now you are ready to make assignments specific to your keymap. Your main tool in doing this will be the function KmapAssign. Use the Codewright API functions, or create your own supporting functions to assign to keys. Remember that when you create your own functions you will need to export it with a LibExport call in the DLL's _init function in order for the key assignment to work. Otherwise, you will get a "function not found" message when you press the keystroke.
Menu Accelerators
The last step in creating your own keymap is to put strings indicating any "short cut" keys or accelerators on the menu. You will rely on the MenuAddKeyString function to do this.
Recompiling a DLL
Part of the Codewright directory structure is a miniature of that used by most C compilers. There is an INCLUDE subdirectory that contains header files, a LIB subdirectory to contain .LIB files, and subdirectories to contain the source code for each of the Codewright DLLs you can rebuild. The INCLUDE and LIB subdirectories must be made known to your compiler and linker. You can do this manually, or through the use of a MAKE utility or Project file, if your compiler supports these things.
306
Recompiling a DLL
WIN32=TRUE The DLLs themselves are generated in either a WIN16 or WIN32 subdirectory of the source file directory, depending on which platform you are compiling for. You will then need to move the DLL up to the Codewright executable directory for it to be used. The Borland compiler relies on configuration files and command line switches to locate include files and libraries, rather than environment variables. As a result, it may be necessary to modify a macro definition in the Borland makefile to indicate the location of these files, unless you have installed the Borland compiler in the default directory of C:\BC45. If you have installed your Borland compiler in another location, modify the value assigned to BORPATH toward the beginning of the makefile. For example, if you installed the compiler in the directory D:\BC45, change the assignment to read as follows: BORPATH=D:\BC45
Adding Files Groups of related files have been defined as macros toward the beginning of each makefile. This facilitates operating on the filenames as a group. Also, if you choose to place the source code for some extensions to Codewright in a separate file, you can readily add those filenames to the macro definitions. If the makefile employs a linker response file, such as CWSTART.LNK, don't forget to add your file to the list in the response file so that it will get linked in.
Link Libraries
The makefiles provided reference certain libraries in the linker command. You may find it useful to know the purpose of each of these libraries in case you have a different version of the same compiler or would like to construct a similar command line for a compiler not supported.
307
Recompiling a DLL
Microsoft Link This is the command line in the makefile for Microsoft C invoking the linker:
link /NOD $(LIBDIR)\libentry @cwstart.lnk, $(DLLDIR)\cwstart.dll,,libw oldnames \ ldllcew $(LIBDIR)\cwright,cwstart.def
The libraries used in this link command are LIBW.LIB, OLDNAMES, LDLLCEW.LIB, and CWRIGHT.LIB. Of these, the files LIBW.LIB and CWRIGHT.LIB are import libraries. They don't contain any object code themselves, but rather tell where the routines may be accessed at runtime. LIBW.LIB points to addresses in USER.EXE, GDI.EXE and other executables that provide the Windows API. CWRIGHT.LIB points to addresses in the Codewright kernel that support the Codewright API. You may need to link in other import libraries at times, for example, if you are making direct calls to routines in CWSTART.DLL, CWMATCH.DLL or a DLL of your own creation. If you don't have an import library (.LIB) file corresponding to the DLL you are using, you can create one with the ILIB utility supplied. ILIB is described a little later in this chapter. The library LDLLCEW.LIB contains object code to use when creating Large memory model Windows DLLs. Depending on your installation of Microsoft C, you may find that your Large memory model library is named LDLLCAW.LIB instead. Alternately, you may find that you have not installed any large model library at all. If so, you can run the setup program that came with your compiler to add to your installation. If you use a library intended for any other memory model you are guaranteed to have a program that doesn't work right, and will probably crash Windows. The library OLDNAMES.LIB is included to avoid unresolved externals. This is because Microsoft changed the names of some of their library routines. See your MSC 7.0 README file for details. If you are using an older version of the Microsoft compiler, you should remove this library from your command line.
Borland Link Below is a portion of the input script for TLINK in the makefile for Borland C/C++:
..\lib\cwright.lib+ import.lib+ cwl.lib The purpose of these libraries follows closely the libraries described above for Microsoft. The libraries CWRIGHT.LIB and IMPORT.LIB are import libraries. IMPORT.LIB is supplied to you by Borland for the Windows API and CWRIGHT.LIB comes from Premia for the Codewright API.
308
The first option may slow down the initial loading of Codewright, whereas the second can cause a short pause when the function is first called. The second option may be better if you have a
309
310
Index
#
#Ifdefs, 58
(
(File) Open Window, 43
_
_init, 305 _init Function, 307
AttrSetPaletteEntry, 169, 170, 191 Auto-Expand/Collapse, 47 auto-indent fill mode, 200 set mode, 200 Auto-save, xiii, 154, 155, 192, 206 Autosave, 191 AUTOSAVE.C, 300 AutosaveDir, 192 AUTOTOOL.TXT, 3 Auxiliary Services, 304
B 3
32 bit disk and file access, 50 BackTab, 192 Backup set file name/location global, 203 set file name/location, 201 Backup files, 80, 138, 139, 162, 202, 203 Backup Files And Directories, 138 Backup Formatting Strings, 139 Backup specification, 202, 203 Backup Specs Illustrative Examples, 141 BlockCopy, 193 BlockCut, 193 Bookmark Window, 47 Bookmarks, 79 Global, 47 Bookmarks Window, 43, 47 Borland, 156 Borland Link, 311 Borland Pascal, 312 Borlands Delphi, xiii BORPATH, 310 BR_adjacent_window, 81 BR_attach, 81 BR_backspace, 81 BR_beginning_of_line, 81
A
Add to User Dictionary Spell Correction Dialog, 22 Adding Your Own Functions, 307 Additional Language Support, 303 Alternation And Grouping, 134 Anchors. See Bookmarks API Assistance, 1 API Assistant, xiv, 65 Automation Tools, 2 checkboxes, 2 Modifying the Database, 2 using, 1 API Database Editor, 2 ASM.C, 300 assembly language, 303 AssignMouseKeys, 191 Associated Dialogs, 50 AttrFindColor, 169 AttrQColor, 169 AttrSelColor, 169 AttrSetColor, 169
311
Index
BR_borders, 81 BR_copy, 81 BR_create_edge, 81 BR_cut, 81 BR_del_to_BOL, 82 BR_delete, 81 BR_delete_curr_buffer, 82 BR_delete_edge, 82 BR_delete_macro, 82 BR_drop_bookmark, 82 BR_edit_file, 82 BR_end_key, 82 BR_end_of_buffer, 82 BR_end_of_line, 82 BR_end_of_window, 82 BR_esc, 82 BR_exit, 82 BR_goto_bookmark, 82 BR_home_key, 82 BR_left_side, 83 BR_load_macro, 83 BR_mark, 83 BR_open_line, 83 BR_playback, 83 BR_print, 83 BR_quote, 83 BR_read_file, 83 BR_remember, 83 BR_right_side, 83 BR_search_again, 83 BR_search_back, 83 BR_search_case, 83 BR_search_fwd, 83 BR_set_backup, 83 BR_set_mode, 84 BR_tab, 84 BR_toggle_clipscrap, 84 BR_toggle_re, 84 BR_top_of_buffer, 84 BR_top_of_window, 84 BR_translate, 84 BR_translate_again, 84 BR_translate_back, 84 BR_translate_fwd, 84 BR_write_and_exit, 84 Brace, 193 placement in templates, 241 Brace Matching, 55 BRACE.C, 300 BraceFind, 57 BraceMatch, 57, 193 Bracematch, 57 BraceMatchNext, 57, 194 Brief, 14, 142, 143, 155, 157 BRIEF, 60, 75 Brief Keymap Functions, 81 Browse, 49 Browser Filter Toggle Buttons, 8 Inspect window, 5 Jump to Code, 6 Query Buttons, 7 Ribbon, 6 Selecting a Database, 5 String Search, 6 Traversing the Tree, 5 Tree window, 5 Window, 4 Browser and Tags Support, 3 Browser ribbon, 5 Browser Support, 4 Browser tree expand or collapse, 5 browsing, xiv, 3 Outline Symbols, 10 Supported File Types, 11 using Microsoft .BSC files, 3 BSC file, 5 BSCMAKE, 5 BufBackspace, 195 BufDelChar, 195 BufDelLine, 196 BufDelSelection, 196 BufDelToEOL, 197 BufEditFile, 197 Buffer current, 79 filter dialog, 222
312
Index
settings dialog, 222 Buffer save dialog, 222 BufInsertChar, 198 BufInsertEOL, 200 BufInsertEOL, 198 BufInsertFile, 199 BufInsertScrap, 199 BufInsertStr, 200 Bufqbackupspec, 138 Bufqglobalbackupspec, 138 BufQMaxTabCol, 204 BufQTabStr, 204 BufSetAutoIndentMode, 200 BufSetBackupSpec, 201 Bufsetbackupspec, 138 BufSetGlobalBackupSpec, 203 Bufsetglobalbackupspec, 138 Bufsethexascii, 145 BufSetMaxTabCol, 204 Bufsetsysflags Function, 138 BufSetTabStr, 204, 248 BufSetTabUsage, 204 BufWrite, 205, 206 BufWriteFile, 205 BufWriteSelection, 206 Bugs, 172 Build, 49 Button Link Deleting, 14 Button links, 12 Comment prefixes, 12 Defining buttons, 12 How it works, 12 View Links, 13 What you see, 12 buttons, 12 action, 12 Calls To, 8 Carriage Return, 131 CenterLine, 206 Change directory dialog, 222 Changing Existing Functions, 306 Character Classes, 131 Character Matching, 131 Check Document Button Spell Check Dialog, 21 Check In Command, 117 Check Out Command, 118 Check Word Button Spell Check Dialog, 21 CheckIn, 207 Check-in Dialog, 209 CheckInBuffer, 208 CheckInSetCmd, 209 CheckOut, 209 Check-out Dialog, 212 CheckOutBuffer, 211 CheckOutSetCmd, 212 ChromaCode, xiii ChromaCoding, 231, 232, 300 language dependent, 229 setting update delay, 242 speeding up, 233 ChromaCoding, 232 Clipboard, 17, 213, 268, 284, 287 define separator string, 213 separator string enable, 213 ClipboardEnableSepStr, 213 ClipboardSetSepStr, 213 Closed Selections, 14 Codewright API, 142 Codewright Api, 143 Codewright CUA Variant, 61 Color Settings Predefined, 169 Color value set for Codewright palette, 191 Color..., 215 ColorAlternate..., 169 ColorCommandLine, 169, 214 ColorComments, 215
C
C Language Operators, 145 C Language Support, 55 C.C, 300 Called By, 8
313
Index
ColorDiffAdd, 215 ColorDiffDel, 215 ColorError, 169, 216 ColorInsertedLines, 215 ColorKeywords, 215 ColorLineNumbers, 169, 215 ColorMessage, 169, 216, 267 ColorModifiedLines, 215 Colors warning messages, 217 window dialog, 222 ColorSelection, 169, 215 Colorselection, 155 ColorSetPallete, 218 ColorText, 169, 215 Colortext, 155 ColorWarning, 169, 217 Column Marking, 15 Column Selection, 15 Command Completion, 142 Command Key, 58, 59, 141, 142, 143, 144, 145, 150, 156, 162, 168 Displaying Return Values, 144 examples, 144 Command Line command files, 168 Flags, 163 Parameters And Options, 163 Command Line Parameters, 163 Command lines, 209, 212, 214, 227 command shell in child window, 50 Comment length optimizing for ChromaCoding, 233 Comments, 193, 231 Common Dialogs, xiii Common User Access, 60 Compact mode, xiii, 57, 65, 67, 80 Compile and Link Options, 310 COMPILE.C, 300 CompuServe, 171 Conditional code, xiii, 58, 156 Definitions Used In, 58 CONFIG.C, 300 ConfigFileRead, 218 Configuration Example File, 154 Configuration and State introduction to, 153 Configuration File, xiii, 58, 152, 153, 155, 156, 161, 163, 164, 165, 167, 218, 248, 249 Execute section in, 218 User Defined Sections, 158 Configuration Hierarchy, 128 Contents Of The State File, 161 Copy, 193 Core Services, 299 Correct All button Spell Correction Dialog, 22 Correct button Spell Correction Dialog, 22 CPP.C, 300 Creating a Project, 122 Creating Definitions, 58 Creating New Keymap Command Sets, 307 Creating Windows With A Mouse, 17 CTags setup, 289, 291 CTags, 289, 290 Ctags Support, 9 Cua, 14, 60, 142, 157 CUA, 60, 75 CUA Key Commands, 60 CUA Variant, 61 CUA_attach, 69 CUA_auto_indent, 69 CUA_back_tab, 69 CUA_backspace, 69 CUA_copy, 69 CUA_cut, 69 CUA_delete, 69 CUA_delete_curr_buffer, 70 CUA_delete_curr_window, 70 CUA_deletion, 68, 70 CUA_drop_bookmark, 70 CUA_edit_file, 70 CUA_edit_next_window, 70 CUA_edit_prev_window, 70
314
Index
CUA_enable_virtual, 63 CUA_end_of_buffer, 70 CUA_end_of_window, 70 CUA_exit, 71 CUA_goto_bookmark, 71 CUA_left_side, 71 CUA_make_window_icon, 71 CUA_mark, 71 CUA_motion, 68, 71 CUA_mouse, 68 CUA_mouse, 71 CUA_mouse_selextend, 71 CUA_next_winbuf, 71 CUA_open_line, 71 CUA_playback, 72 CUA_QPersistSel, 72 CUA_quote, 72 CUA_read_file, 72 CUA_remember, 72 CUA_right_side, 72 CUA_search_again, 72 CUA_search_back, 72 CUA_search_fwd, 72 CUA_sel_persist, 73 CUA_selection, 68, 72 CUA_self_insert, 73 CUA_shiftpage, 73 CUA_tab, 73 CUA_tab_use, 73 CUA_toggle_clipscrap, 73 CUA_top_of_buffer, 73 CUA_top_of_window, 73 CUA_translate, 73 CUA_translate_again, 73 CUA_translate_back, 74 CUA_translate_fwd, 74 CUA_write_and_exit, 74 Cursor Placement After Search, 136 CURSOR.C, 300 Customization, xii, xiii, 143 Cut, 193 CW CUA, 61 CW32.EXE, 152 CWBUTTON.BTN, 43 CWDDE.DLL, 304 CWDIALOG DLL, 302 CWDIALOG.H, 302, 307 CWHelp, 219 CWHELP.H, 307 CWHelpDefaultName, 219 CWINL.LIB, 312 CWL.LIB, 312 CWLDRAW.DLL, 146, 304 Cwpst, 161 Cwright.Ini, 161, 303 Cwright.Ini, 164 CWRIGHT.LIB, 311 CWRIGHT.PST, 167 Cwrightini, 164 CWSTART DLL, 299 CWSTART.DLL, 303, 312 CWSTART.H, 300, 307 cwvdos.386, 51
D
dBASE/Clipper, 300 Debugging, 145 Default Backup Specification, 139 Function Parameters, 144 Keymap, 158 Keymap, 165 Default font dialog, 222 DefaultKeymap, 220, 312 Defines creating, 58 Definitions Creating, 58 Delay ChromaCoding update, 242 DeleteNextWord, 220 DeletePrevWord, 220 Dialog change directory, 222 default font, 222 file differencing, 222
315
Index
file find, 222 file grep, 222 file open, 222 filter utility, 222 go to line, 222 go to mark, 222 merge, 222 multi-buffer search, 222 print, 222 print setup, 222 save as, 222 set mark, 222 Spell Correction, 22 window colors, 222 window font, 222 window settings, 222 Dialogs buffer save, 222 buffer settings, 222 Extension-specific Setup, 222 key bindings, 222 DICT.APP, 20 DICT.D, 20 DICT.I, 20 DICT.S, 20 DICT.U, 20 dictionary files, 20 Difference, 49 Differencing dialog, 222 directory set working, 285 Directory change dialog, 222 Disabling Virtual Space, 62 DisplayFileName, 221 Displaying Return Values, 144 Dissecting a Codewright DLL, 305 DlgFGrep, 247 DlgMenuExec, 223 DlgMenuPopup, 223 Dll Source Code, 143 Dockable Toolbars manually dock and undock, 42 Dockable Toolbars and Windows, 41 dockable windows, 43 Document Languages dialog, 54 Document Settings, 53 Document_Backup Attribute, 138 Drag and Drop Copy, 16 File Loading, 18 Move, 16 Text, 16 Drag and Drop, xiii
E
EditNextBuffer, 224 Editor Highlights, 1 EditPrevBuffer, 224 EdVersion, 224 Elision, xiii, 57, 286 email, 171 End of file, 292 Environment Dialog, 18 Environment variables, 227, 253, 254 Environment Variables, 161 EPSAltPrefix, 100 EPSAppendNextKill, 100 EPSArgument, 100 EPSAutoFillMode, 100 EPSBackwardCharacter, 100 EPSBackwardDeleteCharacter, 101 EPSBackwardKillWord, 101 EPSBackwardParagraph, 101 EPSBackwardSentence, 101 EPSBackwardWord, 101 EPSBeginningOfLine, 101 EPSBeginningOfWindow, 101 EPSBindToKey, 101 EPSBufed, 101 EPSBufferInit, 101 EPSCapitalizeWord, 102 EPSCd, 102 EPSCenterLine, 102 EPSCenterWindow, 102 EPSChangeModified, 102 EPSCopyRegion, 102
316
Index
EPSCopyToFile, 102 EPSCountLines, 102 EPSCtrlPrefix, 102 EPSCtrlXTable, 103 EPSDeleteBlankLines, 103 EPSDeleteChar, 103 EPSDeleteCharacter, 103 EPSDeleteHorizontalSpace, 103 EPSDired, 103 EPSDownLine, 103 EPSEndKbdMacro, 103 EPSEndOfLine, 103 EPSEndOfWindow, 103 EPSEnlargeWindow, 104 EPSEnlargeWindowHorizontally, 104 EPSEnlargeWindowInteractively, 104 EPSEnterKey, 104 EPSExchangePointAndMark, 104 EPSExit, 104 EPSExitLevel, 104 EPSFillParagraph, 104 EPSFindFile, 104 EPSForwardCharacter, 105 EPSForwardParagraph, 105 EPSForwardSentence, 105 EPSForwardWord, 105 EPSGotoBeginning, 105 EPSGotoEnd, 105 EPSGotoLine, 105 EPSGotoTag, 105 EPSGrep, 105 EPSHelp, 105 EPSHighlightRegion, 106 Epsilon Key Commands, 91 Epsilon Keymap Functions, 100 EPSIncrementalSearch, 106 EPSIndentPrevious, 106 EPSIndentRegion, 106 EPSIndentRigidly, 106 EPSInsertChar, 106 EPSInsertEOL, 106 EPSInsertFile, 106 EPSInsertToColumn, 106 EPSJumpToLastBookmark, 107 EPSJumpToNamedBookmark, 107 EPSKillBuffer, 107 EPSKillLevel, 107 EPSKillLine, 107 EPSKillRegion, 107 EPSKillSentence, 107 EPSKillWindow, 107 EPSKillWord, 107 EPSLastKbdMacro, 107 EPSLoadBytes, 108 EPSLowercaseWord, 108 EPSMake, 108 EPSMarkParagraph, 108 EPSMaybeBreakLine, 108 EPSMouseLeftButtonDown, 108 EPSMouseRightButtonDown, 108 EPSMouseRightButtonUp, 108 EPSMouseRightClick, 108 EPSMoveToWindow, 109 EPSNamedCommand, 109 EPSNextBuffer, 109 EPSNextPage, 109 EPSNextPosition, 109 EPSNextWindow, 109 EPSOneWindow, 109 EPSOpenLine, 109 EPSOverwriteMode, 109 EPSPluckTag, 109 EPSPreviousBuffer, 110 EPSPreviousPage, 110 EPSPreviousWindow, 110 EPSPush, 110 EPSQueryReplace, 110 EPSQuotedInsert, 110 EPSRectangleMode, 110 EPSRedo, 110 EPSRedoChanges, 110 EPSRegexReplace, 111 EPSRegexSearch, 111 EPSReplaceString, 111 EPSReverseIncrementalSearch, 111 EPSReverseRegexSearch, 111 EPSROEditEvent, 110 EPSSaveAllBuffers, 111
317
Index
EPSSaveFile, 111 EPSScrollDown, 111 EPSScrollLeft, 111 EPSScrollRight, 111 EPSScrollUp, 111 EPSSelectBuffer, 112 EPSSelectTagFile, 112 EPSSetBookmark, 112 EPSSetFillColumn, 112 EPSSetMark, 112 EPSSetNamedBookmark, 112 EPSShowBindings, 112 EPSShowPoint, 112 EPSShrinkWindow, 112 EPSShrinkWindowHorizontally, 113 EPSShrinkWindowInteractively, 113 EPSSplitWindow, 113 EPSSplitWindowVertically, 113 EPSStartKbdMacro, 113 EPSStartProcess, 113 EPSToIndentation, 113 EPSTransposeCharacters, 113 EPSTransposeLines, 113 EPSTransposeWords, 113 EPSUnassignedKey, 114 EPSUndo, 114 EPSUndoChanges, 114 EPSUpLine, 114 EPSUppercaseWord, 114 EPSVisitFile, 114 EPSWhatIs, 114 EPSWriteFile, 114 EPSWriteRegion, 114 EPSWriteState, 114 EPSYank, 115 EPSYankPop, 115 EPSZoomWindow, 115 ERRINFO.C, 300 ErrKmapAssign, 224 ERRORFIX.C, 300 Escape Sequences, 130 EvalStrAdd, 225 EvalStrDel, 59, 226 Exclusive Selection, 14 ExecApp, 226 ExecCommand, 227 ExecUserCmnd, 227 ExecuteMacro, 228 Executing menu items from keyboard, 257, 258 Expand / Collapse, 18 Expanding And Collapsing Text, 18 EXPORTS.H, 258 Expression Evaluator, 145, 225, 226 ExtAddKeyword, 229 ExtAlias, 229 Extassigntemplate, 23, 231, 239, 241 Extassigntemplate, 24 ExtColors, 231 ExtColorsAssoc, 232 ExtCommentSearchLimit, 233, 242 ExtDelayedColoring, 233 Extensibility, 143 Extension specific tab stops, 247 Extensions File editing, 54 Extension-specific Setup dialog, 222 ExtExpandTemplate, 234, 241 ExtExpandTemplate, 25 ExtIndentEnable, 236 ExtIndentEnableAssoc, 236 ExtKmapAssign, 237 ExtReadKeywordFile, 238, 239 ExtReadTemplateFile, 239 ExtSetDelimiters, 239 ExtSetStyle, 240 ExtSetTemplateMacro, 27, 235, 241 ExtSetUpdateDelay, 242 ExtSetWrap, 242
F
Fax support via, 172 Fax Number, 172 FFind, 243 FFindFile, 243 FFindNext, 244 FFindPattern, 244
318
Index
FFindShow, 245 FGrepFile, 245 FGrepFlags, 245 FGrepNext, 246 FGrepPattern, 246 FGrepScope, 247 FGrepShow, 247 File differencing dialog, 222 File filters add, 248 delete, 249 File filters, 249 File Filters dialog, 249 File Find, 49, 243 file specification, 244 output file, 243 File find dialog, 222 File Grep, 36 files to search, 247 option flags, 245 output filename, 245 search pattern, 246 File grep dialog, 222 File locking, 155 file manager, 48 File merge dialog, 222 File Open Dialog, 48, 222 File print dialog, 222 File save as, 222 File type set word wrap for, 242 File Type Specific Settings, 54 File types associating with language, 54 File View Window, 43, 44 File Icons, 44 filters, 44 Operating on the files, 45 FILE.TPL, 25 Filename Transformation, 138, 139, 140 Filenames, 163 Files loading, 124 FileTabs, 247 Fill Pattern, 140 FILTER.C, 300 FilterAdd, 248 FilterDeleteList, 249 filters file specification, 44 Find files, 243 Flags, 163 Fmatch, 153, 157 FMATCH.DLL, 311 Font default dialog, 222 window dialog, 222 FontSelectMsg, 249 form, 1 forms approach completing function calls, 1 FTEE, 51 FUNCT.TPL, 25 Function substitution, 253 Function Definitions Outline, 55 Function Reference, 189
G
GDI.EXE, 311 General Operation, 138 Get command, 210 Global Bookmarks, 47 Gnu Tags, 9 Go to line dialog, 222 Go to mark dialog, 222 GotoLine, 249 grep, xiii, 19
H
help, 219 Help DLL, 302 Hex mode, xiii, 65, 67, 80, 288 History Of Responses, 150, 151 hotspots on the status line, 15 Hunt for files, 243
319
Index
I
Ignore All button Spell Correction Dialog, 22 Ignore button Spell Correction Dialog, 22 ILIB utility, 311 INCLUDE subdirectory, 309 Inclusive Or Exclusive Selection, 14 Incremental Searching, 38 indenting spaces, 278 InfoView, 2 Insert scrap, 199 Insert Link, 12 InsertMode, 250 Installing Your DLL, 312 Internet Mail, 171 ISearch, 250 ISearch Function, 38 ISearch Function, 38 Iteration Qualifiers, 133 KeyRecord, 251 Keystrings, 225, 238, 250, 252 Keystrokes playback, 251 playback, 65, 67, 77 recording, 251 KmapAssign, 225, 238, 251, 309 KmapAssignRange, 308 KmapAssignTypables, 308
L
Language mapping extensions, 54 Language Dialog, 53 Language dialog, 23 Language Features, 53 Language Indenting, 300 Language settings, 54 Language specific processing assigning to file type, 229 Language Templates, 231 expanding, 234 keymap for, 237 reading definitions from file, 239 special chars in, 231 Special Chars In, 24 LANGUAGE.C, 300 LDDown, 276 LDLeft, 276 LDLLCAW.LIB, 311 LDLLCEW.LIB, 311 LDRight, 276 LDUp, 276 LIB subdirectory, 309 LibAutoLoad, 252 LibExport, 306, 307 LibExport, 307 LibFunctionExec, 27, 236, 253, 306 LibFunctionExec, 141 LibFunctionReplace, 253 LibPreLoad, 254 LibUnLoad, 255
K
Key Assignments, 157, 165 Key bindings dialog, 222 Keyboard executing menu items from, 257, 258 Keyboard Command Sets, 302 Keyboard inactivity, 192, 284, 287 Keycode, 198 Keymap, 251, 253, 286 basic outline of, 307 current, 273 Keymap for Output assigning to, 224 Keymap Function, 308 Keymap overlay assigning to, 237 Keymap Specific Assignments, 309 Keymaps, 191 KeyPlayback, 250
320
Index
LIBW.LIB, 311 Limits, 185 line draw, 276 Line Drawing, 146 line drawing, 276 Line length, xiii Line numbers in print output, 271 Line Selections, 15 LINEDRAW.DLL, 276 Link insert, 12 Link Libraries, 310 List file of Type, 248 Local Bookmarks, 47 Lock Command, 119 Lower, 255 Menu Editor, 148 Menu item executing from keyboard, 257, 258 Menu Items adding, 149 deleting, 149 separator, 149 Menu items, 149 MenuAddKeyString, 309 MenuCmnd, 257 MenuCommand, 258 Menus adding, 148 changing position, 148 deleting, 149 file lists, 150 Merge Function, 173 Merge dialog, 222 Message informative print on status, 266 Metacharacters, 129, 130, 132, 133, 134, 135, 136 Microsoft Foundation Classes, 1 Microsoft Link, 311 Model Buffer, 285 Model Window, 285 Mouse, xv, 14, 17, 191 Copying Text, 17 Creating Windows With, 18 Moving Text, 17 Mouse Commands, 14 Mouse Copy And Move, 17 MouseLeftDClick, 258 MouseLeftDown, 259 MouseRightDown, 259 MovDown, 260 MovEndWin, 260 MovEOF, 261 MovEOL, 261 MovHome, 261 MovLeft, 261
M
Macros run from Button Links, 13 Maintenance Policy, 172 makefile, 310 Making Changes and Additions, 306 Making Mouse Assignments, 19 Margin right mark, 295 margin mark, 55 Margins for printing, 273 Mark set dialog, 222 MarkGoto, 255 MarkRestorePos, 256 Marks. See Bookmarks MarkSavePos, 256 MarkSavePos., 256 MarkSet, 256 Matching braces, 193, 194 Matching parentheses, 194 memory usage specifying, 288 Menu Accelerators, 309 Menu Editor, 148
321
Index
MovNextChar, 262 MovPageDown, 263 MovPageUp, 263 MovPrevChar, 263 MovRight, 264 MovTopBuf, 264 MovTopWin, 265 MovUp, 265 MsgLevel, 266, 267 MsgMessage, 266 MsgPauseOnError, 267 MsgWarning, 217 Multi-buffer search dialog, 222 Multiple Sources Search Dialog, 34 Multi-source Search Options, 34
P
Paradox, 300 Parameter checking, 1 PAS.C, 300 Pascal, 303 Paste, 268 Pctags, 9 Persistent Selections, 62 Phone support via, 172 Phone Number, 172 Playback Strings, 251 PlaybackRecStr, 74 Popup Menu, 19, 27 Definition Sections, 28 Item Definition Lines, 28 Item Hot Keys, 29 pseudo-comment, 28 Separator Lines, 29 Supporting Functions, 29 Pop-up notes, 13 Predefined Templates, 23 PREPROC.C, 300 Pre-Processed View, 57 Pre-Processor Commands, 58 Preprocessor Conditionals, 156 PrevWord, 220, 269 PRG.DLL, 303 Print, 269 Print dialog, 222 Print setup dialog, 222 PrintFlags, 269 PrintFooter, 270 PrintHeader, 271 PrintLineInc, 271, 272 PrintMargin..., 273 PrintSelection, 273 Processing At Startup, 156 Project creating, 122 defined, 121 Project file format, 154
N
newline inserting raw, 198 Newline Character, 24, 130, 131, 198, 199, 200, 214, 220, 231, 267, 269, 294 Next Button Spell Check Dialog, 21 NextWord, 220, 267 note links, 13 NotePad, 60
O
OLDNAMES.LIB, 311 Open File Window, 48 Outline Symbols, xiv, 10 Supported File Types, 11, 46 Outline Window, 3, 43, 45, 46 using, 11, 45 Output filename, 205, 206, 268 Output Window, 3, 4, 11, 36, 41, 46, 48, 49 keymap for, 224 OutputFile, 268 OutputWindow, 268 Override Pattern, 140
322
Index
Project Files, 127 Project Members adding and deleting, 122 Project Properties dialog,, 5 Project Setup Checklist, 123 Project Window, 3, 41, 43, 124 Projects loading member files, 124 selecting or changing, 124 use with version control, 127 using, 124 Projects and Workspaces, 121 Prompt Histories, 150 PROMPT.C, 300 PTG file, 5 Put command, 207 PVCS, 116 PWB, 159 positioning at Beginning/End of Line, 134 Special Characters, 129 Relating Checkboxes to Functions, 160 Repeat, 274 REPEAT.C, 300 Replace Global replacement, 33 Prompted replacement, 33 Single replacement, 33 Replace one function with another, 253 Replace with Spell Correction Dialog, 22 Replacement Options, 33 ResizeWindow, 274 response files, 168 Restrict to Comments/Strings Spell Check Dialog, 21 Restrict to Selection Spell Check Dialog, 21 Restrict to Strings Spell Check Dialog, 21 Ribbon Search, 16 Right Margin Mark, 295 right mouse click, 19
Q
QDefaultKeymap, 273 Query functions displaying results, 144 Quick Search, 8, 39 Quit button Spell Correction Dialog, 22 Quoting, 130, 134, 135, 136
S
Sample DLL, 305 SAMPLE.DLL, 305 Save as dialog, 222 SC.DLL, 303 SCC Provider Interface, 120 Scrap insert, 199 select next, 274 select previous, 275 Scrap Buffer, 17, 196, 199, 200, 268 Scrap buffers multiple, 275 multiple, 159 ScrapNext, 274 ScrapPrev, 274, 275 ScrapSetCount, 275 SDK, 249
R
README.TXT, 171 Recompiling a DLL, 309 Recording keystrokes, 251 Redo, xiii, 64, 66, 67, 76, 79, 274, 292 Reference Groups and Replacement Strings, 135 Regular Expressions, xiii, 129, 130, 133, 135, 136, 137, 279, 280 Alternation And Grouping, 134 Character Classes, 132 Escape Sequences, 130 Examples, 137 Iteration Qualifiers, 133 Matching End Of Line, 134
323
Index
Search for word at cursor, 39 Ignore case, 32 Maximal match, 32 multi-source Documents only, 35 Edit Modified Files, 36 Files and folders, 35 Output Window, 36 Project, 35 Threaded, 36 on toolbar, 39 Regular expression, 32 Restrict to selection, 33 Retain selection, 33 Select matching string, 33 Whole word, 33 Wrap, 33 Search After Go To, 8 search and replace, 31 Dialog, 31 Multi-source, xiii Settings, 32 Search List, 35 Drive and Directory Lists, 37 File Pattern, 37 Include Directory, 37 List Editing Buttons, 38 Patterns List, 37 Search Options, 39 Search Options dialog, 16, 32 Search Pattern List editing, 37 Search results window, 49 Search Subdirectories, 36 Searching incremental, 38 Searching Project Files, 127 Select View via Tabs, 49 Selections by Word, 15 Closed, 14 Exclusive, 14 Inclusive, 14 Line, 15 Mouse, 14, 15 persistent in CUA, 62 Reopening, 14 Selective Display, 19 dialog, 19 Using, 19 SelectWord, 275 Separator string enable, 213 Set auto-indent mode, 200 backup file location, 201 backup file name/location global, 203 color value for Codewright palette, 191 name of state file, 281 tab character usage, 204 tab stop definition string, 204 word wrap by file type, 242 SetLineDrawBindings, 147, 276 SetLineDrawStyle, 276 SetLineDrawStyle, 147 Settings buffer dialog, 222 window dialog, 222 Shell buffer, 50 Sidebar File Open, 48 SLIDE.C, 300 SlideIn, 277 SlideOut, 277 Smart Indenting, 236 Source Code v. Command Key, 143 Source Integrity, 117 Space, 278 space key, 278 Special Characters, 24, 129, 231 Specifications, 178, 185 Spell Check Dialog, 20 Spell checker, xiv, 20 Spell Correction Dialog, 22 SrchFind, 278 SrchQFlags, 279
324
Index
SrchSetFlags, 279 SrchTranslate, 281 STARTUP.C, 300 State File, 151, 153, 156, 161, 163, 168 Contents, 161 set filename, 281 STATE.C, 300 StateSetFilename, 281 Status line set font for, 249 Status Line Actions, 15 Submenu adding, 149 Submenus, 149, 150 Suggest Alternate Spellings Spell Check Dialog, 21 Symbol Definitions Creating, 58 Symbol Window, 11, 46 Symbols, 3 Output Window tab, 49 Symbols Window, 3 SysBeep, 282 SysCaretHeight, 282 SysCaretWidth, 283 SysEdit, 60 SysExit, 283 SysQFlags, 284 SysSetCwd, 285 SysSetDefault, 285, 308 Syssetdefault, 155, 157 SysSetFileLocking, 154 SysSetFlags, 284, 308 SysSetUserFlags, 286 SysSwapBlocks, 288 System Overview, 298 Tab stops, 204, 247, 248, 288, 289 define for file type, 247 set definition string, 204 Tabbed Output Window, 48 Tabs, 133, 135, 198, 200, 204, 205, 248, 253, 286, 288, 292 Select View via, 49 TABSET.C, 300 TagFind, 289, 290 Tagfind Function, 10 TagIgnoreCase, 289 TagNext, 10 TagPrev, 10 TagPrompt, 290 Tags Database Using, 10 Tags Database, 9 Tags Setup, 9 Tags Support, 3, 9 TAGS.C, 300 TagSetFile, 290, 291 TagsWnn, 4 Technical Support, 171 Template Definitions adding and changing, 23 Template Expansion, 300 Template Expansion, 236 Template Macros, 23 list of, 26 Templates containing macros, 234 for language constructs, 23 predefined, 23 reading definitions from file, 239 run from Button Links, 12 special characters in, 24 using macros in, 24 The _init Function, 305 The Key Commands, 60 TLINK, 311 ToBottom, 291 Toolbar Bindings, 43 Select Buttons, 42
T
Tab, 288 inserting raw, 198 menu editor, 148 Tab character enable usage, 204
325
Index
Toolbar Search, 39 Toolbars, xiii Docking and moving, 42 Enabling and Disabling, 41 Toolbars and Buttons, 42 Toolbars and Windows dockable, 41 ToTop, 291 Transformation Fill Pattern, 140 Override Pattern, 140 Transformation Patterns, 140 VI Key Commands, 85 virtual space Disabling in CUA, 62 Visibles, 292 Visual Basic, 312 Visual SourceSafe, 116
W
Warning messages color, 217 Web Page, 171 Wildcard, 197, 248 Wildcard patterns, 248 Win.Ini, 18 Window default creation position, 293 window font dialog, 222 Window settings dialog, 222 Windows, xiii Windows .Ini Files, 153 Windows API, 1 Windows File Manager, 18 Windows for Workgroups V3.11, 50 WINDOWS.H, 219 WinScrollHInc, 292 WinSetCreationPos, 293 WinVisible..., 294 WinVisibleEOF, 294 WinVisibleEOL, 294 WinVisibleMarginCol, 295 WinVisibleSeparator, 294 WinVisibleSpaces, 294 WinVisibleTabs, 294 WinVisibleVirtLines, 294 WinVisibleVirtSpaces, 294 Word Selections, 15 Word Wrap, 54 enabling, 295 paragraph reformat, 296 set by extension, 242 setting right margin., 296 Working Directory, 152, 161, 164, 167, 285
U
Undo, xiii, 64, 66, 67, 77, 79, 80, 196, 292 Unmatched curly braces, 193 Updating Source With Merge, 173 Upper, 292 User Defined Sections, 158 USER.EXE, 311 User-definable Popup Menu, 27 Using and Modifying the Makefiles, 309 Using the API, 143 Using the Tags Database, 10 Using Your Own DLL, 312
V
VCS Maintenance Dialog, 120 VCS.C, 300 VDOS, 49, 50 Version Control, 208, 209, 211, 212 Check In Command, 117 Check Out Command, 118 Check Out with Lock Command, 118 Command Line Interface, 117 interface, 207, 209 interface selection, 116 Log Command, 119 Manager Command, 119 Unlock Command, 119 Version Control Setup, 116 VI Command Summary, 85
326
Index
Workspace creating, 125 defined, 121 saving, 125 updating current, 126 Workspaces selecting or changing, 126 WrapEnable, 243, 295 WrapEnable, 242 WrapParagraph, 243, 296 WrapSetRightMargin, 243, 296 WrapSetRightMargin, 296 WriteBuffer, 297
Z
ZoomWindow, 297
327
Index
328