<<

syn Users Manual

Users Manual for syn Version 2.1 September 23, 2003

Stefan Ascher Abstract

This is the Document which describes syn. If you don’t know how to figure out some stuff you should consult this paper. syn is an Open Source Text- and Programming Editor with Syntaxhighlight for many Languages, and some IDE Features, like starting a program (e.g. ) and capture the output, support for Projects etc. syn is written in (Version 5, Updatepack 1) for maximum performance, stability and filesize, hence it doesn’t require any bulky VC++/VB Runtime or MFC libraries! I tried to keep this program as general as possible, to make it useable for many purposes, but the primary intendentation is the usage in conjunction with and Interpreters. This is the reason that there is much to configure, and it appears complicated at the beginning. It could also be a good startingpoint for your own IDE written with Delphi, because the Editor part is already done. The documentation consits of three files, syn.pdf this document, qaa.pdf some questions and answeres and scriptref.pdf the Script reference. References in the Document will appear as blue Link, Links to Sites are coloured red. To jump to the target from a Link click on it. The References show the number from the section, figure or table. CONTENTS I

Contents

1 Introduction 1

2 Copyright 2 2.1 Trademarks ...... 2

3 License 3 3.1 Ataglance ...... 3 3.2 Manual...... 3

4 Installation 4 4.1 Install ...... 4 4.2 Uninstall...... 4 4.3 Update...... 4 4.4 Repair ...... 5

5 Getting Started 6 5.1 Profiles...... 6 5.1.1 Configure Profiles ...... 8 5.1.2 Run Profile Directive ...... 9 5.1.3 Output Expression ...... 10 5.1.4 Examples...... 11 5.1.5 Using Environment Variables ...... 14 5.1.6 Interacting with the Console ...... 15 5.2 Variables...... 15 5.2.1 Run...... 15 5.2.2 InsertString ...... 17 5.3 Using syn as Console Window ...... 17 5.4 DelphiFormfiles ...... 21 CONTENTS II

5.5 Tools...... 21 5.5.1 Launch a Program ...... 21 5.5.2 Execute an Editcommand ...... 22 5.5.3 InsertaString ...... 22 5.6 Projects ...... 22 5.7 Monitor for external changes ...... 24 5.8 LimittooneInstance...... 24 5.9 Generating PDF Files ...... 25 5.10 The Custom Highlighter ...... 25 5.10.1 Fileformat ...... 25 5.11 Autocomplete ...... 27 5.11.1 Example for ...... 28 5.11.2 PopupList ...... 29 5.12 Editcommands...... 30 5.12.1 Uncategorized Commands ...... 30 5.12.2 Fomat...... 31 5.12.3 ChangeCase...... 32 5.12.4 Block ...... 32 5.12.5 Advanced...... 33 5.13 Searchcommands ...... 34 5.13.1 Find...... 34 5.13.2 Find next/previous Word ...... 34 5.13.3 Incremental Search ...... 35 5.13.4 FindinFiles ...... 35 5.13.5 Replace...... 37 5.13.6 Goto...... 37 5.13.7 Goto previous/next Output Item ...... 38 5.13.8 Gotolastchange ...... 38 CONTENTS III

5.13.9 ShowCaret...... 38 5.14 UsingCtags ...... 38 5.15 Calling a Helpfile depending on the Syntax Sheme ...... 40 5.16 FTP ...... 40 5.17 FileExplorer ...... 42 5.18 BookmarkFiles ...... 44

6 Menus 45 6.1 FileMenu ...... 45 6.2 EditMenu...... 46 6.3 SearchMenu...... 46 6.4 View Menu ...... 46 6.5 Project Menu ...... 47 6.6 RunMenu...... 47 6.7 ScriptMenu...... 47 6.8 ToolsMenu ...... 48 6.9 WindowMenu...... 48 6.10 Help Menu ...... 49 6.11 EditorPopupMenu...... 49 6.12 Window Bar Popup Menu ...... 49 6.13 Workspace Popup Menu ...... 49 6.14 File Explorer Popup Menu ...... 51 6.15 Output Window Popup Menu ...... 51 6.16 Marker Popup Menu ...... 52

7 Toolbars 54 7.1 MainToolbar ...... 54 7.2 Project Toolbar ...... 54 7.3 RunToolbar...... 54 CONTENTS IV

7.4 EditToolbar...... 54 7.5 ScriptToolbar...... 54 7.6 ToolsToolbar ...... 55 7.7 WindowToolbar ...... 55 7.8 FileExplorer ...... 55 7.9 Worspace ...... 55 7.10 OutputWindow...... 55 7.11 WindowBar...... 58 7.12 StatusBar...... 58

8 Program Options 60 8.1 General ...... 61 8.2 View...... 62 8.3 Print...... 63 8.4 Associations ...... 63 8.5 Run ...... 64 8.6 Scripts...... 65 8.7 Tools...... 66 8.8 FTP ...... 66 8.9 Editor General ...... 67 8.10 Syntaxhighlight ...... 68 8.11 Highlighter...... 68 8.11.1 Highlight ...... 68 8.11.2 Autocomplete ...... 68 8.11.3 Profiles ...... 70 8.11.4 Help...... 70 8.11.5 Ctags...... 70 8.12 Autocorrect ...... 71 8.13 Spell Checker ...... 71 CONTENTS V

8.14 Editoroptions ...... 72 8.15 Gutter ...... 73 8.16 Shortcuts ...... 73

9 Page Setup 74 9.1 Margins ...... 74 9.2 Header/Footer ...... 74

10 Customize 76 10.1 Toolbars ...... 76 10.2 Keyboard ...... 77 10.3 Mouse ...... 77 10.4 Options ...... 78

11 Projectoptions 80 11.1 General ...... 80 11.2 Files ...... 80 11.3 Profiles...... 81 11.4 Tools...... 81

12 Other Windows 82 12.1 ParametersDialog...... 82 12.2 NewDialog ...... 83 12.3 WelcomeDialog...... 83 12.4 ConfigureTools ...... 83 12.4.1 Launch Program ...... 86 12.4.2 InsertString ...... 87 12.4.3 Execute Editcommand ...... 87 12.4.4 DOSCommand ...... 87 12.5 SaveDialog ...... 87 CONTENTS VI

12.6 Confirm Replace Dialog ...... 88 12.7 MarkerDialog...... 88 12.8 File Properties Dialog ...... 89 12.9 FileVersions...... 90 12.10 WindowsDialog...... 90 12.11 Print Preview Window ...... 91 12.12 KeyboardMap ...... 91

13 Default Keyboard Map 93 13.1 File...... 93 13.2 Edit ...... 94 13.3 Search ...... 95 13.4 View...... 96 13.5 Project ...... 96 13.6 Run ...... 96 13.7 Script ...... 96 13.8 Tools...... 97 13.9 Window ...... 97 13.10 Help ...... 97

14 Commandline Switches 98

15 Messages 100

16 Regular Expressions 102 16.1 Someexamples ...... 102 16.2 Detailed explanation ...... 102

17 Escape Sequences 105 CONTENTS VII

18 SynTray 106 18.1 Menu...... 106 18.2 Commandline Switches ...... 107

19 asgrep 108 19.1 License...... 108 19.2 Introduction...... 108 19.3 Commandline Switches ...... 108 19.4 Using a configurationfile ...... 109 19.5 Results...... 111 19.6 ReplaceText...... 111 19.7 Credits...... 111

20 synclp 112 20.1 License...... 112 20.2 Introduction...... 112 20.3 Commandline Switches ...... 112

21 Requirements 114

22 Known Problems 115

23 Features 116 23.1 Available Highlighters ...... 117

24 What’s planned 120

A Statistics 121 A.1 Forsyn.exe ...... 121 A.1.1 Project Lines ...... 121 A.1.2 LibraryLines...... 121 CONTENTS VIII

A.1.3 TotalLines...... 121 A.1.4 Routines ...... 121 A.1.5 Variables ...... 121 A.1.6 Constants...... 121 A.1.7 Classes ...... 121 A.1.8 Interfaces ...... 122 A.1.9 Records...... 122

B syn Developers 123

C Credits and Contributors 124

D Contact 126

E Version 1.1 127 E.1 Definitions...... 127 E.2 Source Code License...... 128 E.3 Distribution Obligations...... 130 E.4 Inability to Comply Due to Statute or Regulation...... 132 E.5 Application of this License...... 132 E.6 Versions of the License...... 133 E.7 DISCLAIMER OF WARRANTY...... 133 E.8 TERMINATION...... 134 E.9 LIMITATION OF LIABILITY...... 135 E.10 U.S. GOVERNMENT END USERS...... 135 E.11 MISCELLANEOUS...... 135 E.12 RESPONSIBILITY FOR CLAIMS...... 136 E.13 MULTIPLE-LICENSED CODE...... 136 CONTENTS IX

F GNU Free Documentation License 138 F.1 Applicability and Definitions ...... 138 F.2 VerbatimCopying...... 140 F.3 CopyinginQuantity ...... 140 F.4 Modifications ...... 141 F.5 CombiningDocuments ...... 143 F.6 Collections of Documents ...... 143 F.7 Aggregation With Independent Works ...... 144 F.8 Translation ...... 144 F.9 Termination ...... 144 F.10 Future Revisions of This License ...... 145 1 INTRODUCTION 1

1 Introduction

This Program is a File- and Programmingeditor with Syntaxhighlight support for about 40 different Languages. Some basic IDE features are also implemented, like launching a compiler (5.1), or any other program, and redirecting the output to this program, Find in Files (5.13.4), supports projects, but the main feature is the advanced Editor with powerful edit- and searchfunctions. For a more complete list of features please refer to 23. The intention for writing this Program was to make a small and fast Syntaxeditor, and later to make a small and fast IDE like Program, not a replacement for Notepad. This is the reason for not supporting automatic Linebreak, like Notepad, as it is unusual for Programmingeditors. Sure, it would be neat for HTML Documents, but this isn’t a HTML Editor either. BTW. I like Notepad! If you’re looking for a replacement for Notepad try EDXOR1 an excellent Editor which offers all the features from Notepad (e.g shows binary files to the end) and much more. The size is only 21 KB and it’s terrific fast. I use syn mainly for Freeware compilers, different Scriptlanguages, but also for HTML Documents. This Program is based on the MDI Editor sample to the SynEdit Editor Component Suite, check it out: http://synedit.sourceforge.net/. If you want to link to syn use the button (syn.png, 2 KB) in the programfolder, the address is: http://syn.sourceforge.net/. Thanks to all of you users who have tested this program, helped me in bug tracking, made great suggestions and buttons for this program. People who have contributed essentially to the code of the program or documentation or in an other way are listed in the Credits () section. Without their help and work and providing all or almost all that for free, or free for noncommercial use, syn would not be what it is now, or it would not exist at all. Anyway, I hope you’ll enjoy this piece of Software, and it does not hassle you to much. I’m studying psychology and, as such, I don’t want to risk your mental health. Have a lot of fun!

1EDXOR excellent Notepad Replacement, you can download it at: http://www.ozemail.com.au/ ∼nulifetv/freezip/freeware/. 2 COPYRIGHT 2

2 Copyright syn Copyright c 2000–2003 by the syn Developers, see Appendix B

2.1 Trademarks

Microsoft and Windows are trademarks of Microsoft Corporation, Delphi is a Trademark of Borland Corporation. All other products and company names mentioned herein may be the trademarks of their respective owners. Trademarks appear throughout this document without any trademark symbol. So you can’t assume that the names are free. There is no intentions of infringement; the usage is to the benefit of the trademark owner. 3 LICENSE 3

3 License syn is subject to the Mozilla Public License Version 1.1 (the “License”); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an as is basis, without war- ranty of any kind, either express or implied. See the License for the specific language governing rights and limitations under the License. Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the “GPL”), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the GPL.

3.1 At a glance

You can do anything with it, even commercial things, but when you make changes to the source you must publish the modified source, or a Patch file to reproduce your modifications. It is not necessary to publish the source of the entire project, the MPL is not infectious like e.g. the GPL. See Appendix E for the complete Text.

3.2 Manual

The Source of the Manual is released under the GNU Free Documentation License (the “FDL”) Version 1.1, see Appendix F for the entire Text. You can download the Source of this Manual either via CVS, subdirectory “manual”, or you can download the Source distribution from the Download page. 4 INSTALLATION 4

4 Installation

4.1 Install

Run the Setup (synsetup.exe) program e.g. with a doubleclick on the file, and follow the instructions on the screen. If you choose to associate *.syp files with syn, you’ll need write access to the HKEY LOCAL MACHINE Registry key. Ordinary users are not allowed to write to this key on Windows 2000, you’ll need Administrator or Power User Privileges, when you’re using Windows 2000, Windows NT 4.0 is no problem. You will get an Error Message when it is not possible to write to this key, but you can just ignore it. There is no other reason to be logged on as Administrator, it does not copy or replace files in your Windows or System Directory.

4.2 Uninstall

This is easy: Either use the Uninstall Icon in the Startmenu, or open the Control Panel Software, select syn from the list and click Add/Remove. Then follow the instructions on the screen. The uninstaller will delete all Registry keys, but probably not all files, you may delete them manually. The Uninstaller will also not remove the shipped *.dci files, hence the Programfolder will remain on your System after uninstalling, you can easily delete it manually, if you don’t want to keep this files.

Caution: If you uninstall syn you will loose all your settings. If you upgrade to a newer version don’t uninstall it, just run the Setup Program. It will detect automatically obsolete files and it will replace them with the new files.

4.3 Update

To update to a newer version from syn just run the setup program, and install it in the same directory as the old version, don’t uninstall previous installations. If you want to run different versions from syn, select another program directory, but note, all versions share the same Registry keys. 4 INSTALLATION 5

4.4 Repair

If you want to repair an Installation, or you want to install additional Components, just run the Setup Program again, and install it in the same directory as the existing Pro- gram. The Setup Program should automatically choose the Directory from an existing Installation. 5 GETTING STARTED 6

Figure 1: Compiler Output from FreePascal

5 Getting Started

This section should give you a quick overview of the features from syn, and how to use and configure them.

5.1 Profiles

It is possible to start programs with syn and capture the Output when these programs are console Programs. This makes it possible to compile a file with a Compiler (for an example see Figure 1), or run one with a Interpreter, or you can use it to check the Syntax of a Document, e.g. HTML Documents with HTML Tidy2 . But first you’ll have to configure the Programs at the Syntaxhighlight Section (8.10) (Page Profiles) in the Options Dialog (8), or at the Profiles Page (11.3) in the Project Options Dialog (11). Optionally you can use the “Configure” Command from the Run Menu to show the Configure Profiles Dialog (Figure 2) for the current Language or Project.

2HTML Tidy is a Program to validate HTML Documents, you can download it at: http://www.w3. org/People/Raggett/tidy/. 5 GETTING STARTED 7

Figure 2: Configure Profiles

Programs to run against a certain file are organized in so called Profiles. One Profile may contain one or more Programs, which are executed one after the other, and one Language or Project may have none or more Profiles. The count of Profiles of a Language or Project, and the count of Programs in a Profile is in principle unlimited. This is particular useful when a file is processed by more than only one program, e.g. compiling a Source file with a Compiler, Assembler and Linker, or running LATEX, MakeIndex and Bibtex on a LATEX file. The Profiles for the Languages are saved to the Registry, and for the Projects to the project file. syn has no built in Debugger, this would be cool, a Debugger for about 40 Languages ;-), but I’ve made this Profiles stuff as general as possible, so you can run almost every program with it (btw. it’s a science of its own to write a Debugger, Compiler, Interpreter etc.). 5 GETTING STARTED 8

5.1.1 Configure Profiles

It is possible to configure for each Language and Project a Program or a collection of Programs, so called “Profiles”, which you can start with the Run File or Run Project Commands. Each Language and Project can have as many Profiles as you want. To do so, use for a Language Profile the Options Dialog, Page Syntaxhighlight (8.10), and for Project Profiles the Project Options Dialog, Page Profiles (8.11.3). Alternatively you can use the Configure Profiles Dialog (Figure 2), you can show this Dialog with the Configure Command in the Run File or Project Submenu.

Profile: Select the Profile to configure.

Programs: This is the List of Programs to call when using the Run File or Project Command. The order is the same as in the List.

Program: Enter here the Filename of the Program to call.

Arguments: Optional Arguments to pass to the Program.

Directory: Enter here the Workingdirectory for the called Program.

Output Expression: A Regular Expression String to parse the emitted line, more informations can be found in Section 5.1.3.

Hidden: If checked the Window of the Program is invisible.

Detach: Uses the flag DETACHED_PROCESS instead of the CREATE_NEW_CONSOLE flag for CreateProcess. This makes it possible to run the Program not hidden, without showing a Console window. I introduced this because Rterm doesn’t show a GUI when it is hidden.

Timeout: After this time in seconds since the last output from the Program it shows a MessageBox to ask you whether to terminate the Process or not. Enter 0 for no limit.

Delay: Time in seconds to wait until it starts this Program.

Exit: Continue running the Profile when this program exits with this Exit. Code. Enter -1 to continue anyway. This is useful when you have e.g. a Compiler and a Linker in a Profile and the compilation was not successful, then there is no need to run the Linker. 5 GETTING STARTED 9

Figure 3: Edit Profiles

To add or remove a Profile to the Language or Project use the Edit Profiles Dialog (Figure 3), you can show this Dialog with the Profiles (. . . ) Button right hand side from the Profiles Combobox.

5.1.2 Run Profile Directive

You can specify the default profile in the file, to do so use the “RunProfile” directive. Example, lets assume you have a Pascal source file, and a Profile for Free Pascal, and you want to make this Profile always to be the default for this file:

{RunProfile=Free Pascal|} program Untitled; uses Windows, SysUtils; [...] end.

You see that the RunProfile directive is comment, this is to not confuse the compiler. This file would always use the Free Pascal Profile as default profile. The default profile 5 GETTING STARTED 10

Figure 4: Default Profile is marked bold in the Menu, like in Figure 4, and is used when you use the “Run File” and “Run Project” command. To run another Profile than the default one use the appropriate Menuitem. You see this directive is in Comments. As Last character use | otherwise it reads the Profile name to the end of the line, this wouldn’t work in this case, because the last character is }, which isn’t part from the Profile name. It reads this directive always from the currently active Document.

Note: This syntax is case sensitive, the “RunProfile” directive as well as the Profile name, in this case “Free Pascal”.

5.1.3 Output Expression

Configuring the Output Expression will enable you to jump to the emitted errormessage from a console program (e.g. a compiler) with doubleclicking on an Item in the Output 5 GETTING STARTED 11 list. It uses Regular Expressions to parse the emitted line and to find the filename, linenumber and/or columnnumber. You can find more informations about Regular Ex- pressions in section 16. For some Examples see Table 1.

Outputline Output Expression Examples file.ext(100) $[FileName]\($[LineNumber]\) CSL, Delphi file.ext(100, 21) $[FileName]\($[LineNumber], $[ColNumber]\) WSH file.ext(100,21) $[FileName]\($[LineNumber],$[ColNumber]\) Free Pascal file.ext:100: $[FileName]:$[LineNumber]: JDK, NASM file.ext 100 $[FileName] $[LineNumber]

Table 1: Output Expression

Note: Each Bracket and other reserved Characters must be escaped with a Backslash, as shown in the Table above. For a list of reserved Characters see the Regular Expressions Section (16).

The placeholder “$[FileName]” represents either a filename with or without path. The current directory is set to the path from the file to run, if there is no file opened it is set to the path from the Project, so it will be found in any way, even if the outputline contains only the filename without the path. Don’t mix up the current directory for this program and the workingdirectory for the called program. Each Process can have its own workingdirectory.

5.1.4 Examples

For a Step by Step Example for compiling a Pascal program with the Free Pascal com- piler see the How To section in the Questions and Answers Document.

Compiling a file using Sun’s JDK: The commandline can look like this (you have to modify the paths): javac.exe -O -deprecation -classpath "$[ActiveDocPathShort]\; d:\programme\jdk1.1.8\lib\classes.zip" -d "$[ActiveDocPathShort]" "$[ActiveDocLong]" 5 GETTING STARTED 12

“$[ActiveDocLong]” represents the filename from the active document in LONG file- format. For a description to the switches and parameters see the JDK documentation. Outputline can look like this:

D:\Eigene Dateien\HP\chess\chess.java:344: ’;’ expected. c.CurrentY = cm[i].CurrentY ^

As Output Expression you should use “$[FileName]:$[LineNumber]:” For the Jikes3 Java Compiler use as Output Expression “$[LineNumber].”, the com- mandline is similar to the JDK Compiler.

Compiling a C(++) file with Borlands free C++ Compiler: Here is a brief description how to compile a C++ or C program with syn using BCC 5.54: Create a new RunProfile for the C++ Language and enter the following informations, you have to change the paths according your installation: Program:

D:\BCC55\Bin\bcc32.exe

Arguments:

-ID:\BCC55\Include -LD:\BCC55\Lib -n$[ActiveDocPathShort]

-I Include Paths -L Library Paths -n Output directory

For a more detailed description of the switches and options consult the Manual to the BCC program (bcb5tool.hlp) located in the help subdirectory. Directory:

3Jikes is a Java Compiler from IBM, it’s free and you can download it from http://www10.software.ibm.com/developerworks/project/showfiles.php?group id=10. 4Borland has released their excellent C++ compiler C++Builder 5.5 for free, you can download it from http://www.borland.com/products/downloads/download cbuilder.html. 5 GETTING STARTED 13

D:\BCC55\Bin

Output Expression for BCC is a bit tricky, but Regular Expressions are very powerful. When BCC finds a Syntax Error – the example error bellow is a missing Semicolon at the end of a statement – it may look like this:

Error E2379 D:\Eigene Dateien\Delphi Projekte\syn\test\test.c 97: Statement missing ; in function WinMain

So, use the following expression:

^\w+\s\w+\s$[FileName]\s$[LineNumber]:

1. ^ Beginnig of the line

2. \w+ Any Character one or more times, e.g. Error, Warning, etc., in this case Error

3. \s Any Space

4. \w+\s Same as above, in this case E2379

5. $[FileName] The filename

6. \s Another space

7. $[LineNumber] The Linemuber

When you create now a new program based on the C Console Template, let’s call it test.c, it should already compile fine, and you’ll get a small console program. It should do nothing more than emitting only: test.exe usage:

If your C(++) program consists of more than only one source file you should use a Makefile and call the Make program with the Makefile, instead of calling the compiler directly. 5 GETTING STARTED 14

Validating HTML documents using HTML Tidy: Make a configurationfile called config.txt located in the directory from the HTML Tidy programfile. Commandline (you have to modify the path): tidy.exe -config config.txt -m $[ActiveDocShort]

The -m Switch is used to get HTML Tidy to update the source file, if you don’t want to update the Source file, don’t use this Switch. Use as Output Expression ”line $[LineNumber] column $[ColNumber]”.

Compiling Resource Scripts using (Microsoft’s) RC.EXE: Commandline (you have to modify the path):

RC.EXE /v /i {Some include paths} "$[ActiveDocLong]"

Output Expression: “$[FileName]\($[LineNumber]\)”

Running a Batch File which is currently the active Document: Just enter $[ActiveDocShort] as Program, and $[ActiveDocPathShort] as Directory. The Output Window (7.10) with the Outputlist appears everytime when you use one of the Run File or Run Project Commands and it will show the output from the called program.

5.1.5 Using Environment Variables

You may use Environment variables in the Program, Arguments and Directory field. Let’s assume you want to compile a Resource Script with Microsofts RC.EXE, and this file is placed in the Directory of , then you may use:

%MSDEVDIR%\Bin\Rc.exe

This would translate on my computer into:

D:\Programme\Microsoft Visual Studio\Common\MSDev98\Bin\Rc.exe

In the same way you can use it for Arguments, e.g.:

/i "%INCLUDE%" /r /v "somefile.rc" 5 GETTING STARTED 15

5.1.6 Interacting with the Console

If you’ve started a program in this way the Outputlist will appear, and there is a TextBox while this program is running where you can enter commands which are sent – i.e. written to StdIn – to the console program. This TextBox is only visible when the program is running. This TextBox has also a Popupmenu with some useful commands, you can e.g. save the list, load a list etc.

5.2 Variables

A description of Variables which can be used at some places.

5.2.1 Run

This is a list for all variables which you can use in the Commandline from Run/Check and the Tools, but you can also use the Popup Menu to insert these variables, see Table 2 for some examples:

$[ProjectPathShort]: Short Pathname from the currently opened Project.

$[ProjectPathLong]: Long Pathname from the currently opened Project.

$[ProjectFileShort]: Short Filename from the currently opened Project.

$[ProjectFileLong]: Long Filename from the currently opened Project.

$[ActiveDocShort]: Short Filename from the active Document.

$[ActiveDocLong]: Long Filename from the active Document.

$[ActiveDocShortNoExt]: Short Filename from the active Document without the fileextension.

$[ActiveDocLongNoExt]: Long Filename from the active Document without the file- extension.

$[ActiveDocTitleShort]: Short Filename from the active Document without the path.

$[ActiveDocTitleLong]: Long Filename from the active Document without the path. 5 GETTING STARTED 16

$[ActiveDocTitleShortNoExt]: Short Filename from the active Document without the path and the file extension.

$[ActiveDocTitleLong]: Long Filename from the active Document without the path and the file extension.

$[ActiveDocPathShort]: Short path to the active Document.

$[ActiveDocPathLong]: Long path to the active Document.

$[ActiveDocExt]: Returns the Extension from the active Document.

$[FileNameShort:?0]: Shows the Open Dialog to choose a Filename.

$[FileNameLong:?0]: Same as above, but it does not convert it into a short filename.

$[ModFiles]: Returns all modified files separated with a Space.

$[CurWord]: Returns the Word under the Caret.

$[Prompt:0]: Prompts you to enter a word.

$[ProgramPathShort]: Short path to the program.

$[ProgramPathLong]: Long path to the program.

Systemdirectories:

$[WinDirShort]: Windows directory.

$[SysDirShort]: System directory.

$[TempDirShort]: Temporary directory.

All directories are returned without trailing backslash, because it’s much easier to add one, than to remove one. 5 GETTING STARTED 17

Variable Input Result $[ProjectPathShort] C:\mydirectory\myproj.syp C:\mydire˜1 $[ProjectPathLong] C:\mydirectory\myproj.syp C:\mydirectory $[ProjectFileShort] C:\mydirectory\myproj.syp C:\mydire˜1\myproj.syp $[ProjectFileLong] C:\mydirectory\myproj.syp C:\mydirectory\myproj.syp $[ActiveDocShort] C:\mydir\myfilename.html C:\mydir\myfile˜1.htm $[ActiveDocLong] C:\mydir\myfilename.html C:\mydir\myfilename.html $[ActiveDocShortNoExt] C:\mydir\myfilename.html C:\mydir\myfile˜1 $[ActiveDocLongNoExt] C:\mydir\myfilename.html C:\mydir\myfilename $[ActiveDocTitleShort] C:\mydir\myfilename.html myfile˜1.htm $[ActiveDocTitleLong] C:\mydir\myfilename.html myfilename.html $[ActiveDocTitleShortNoExt] C:\mydir\myfilename.html myfile˜1 $[ActiveDocTitleLongNoExt] C:\mydir\myfilename.html myfilename $[ActiveDocPathShort] C:\mydirectory\myfile.html C:\mydire˜1 $[ActiveDocPathLong] C:\mydirectory\myfile.html C:\mydirectory $[ActiveDocExt] C:\mydirectory\myfile.html html $[ProgramPathShort] C:\programdir\myprog.exe C:\progra˜1 $[ProgramPathLong] C:\programdir\myprog.exe C:\programdir $[WinDirShort] C:\WinNT $[SysDirShort] C:\WinNT\system32 $[TempDirShort] C:\Temp

Table 2: Variable Examples

5.2.2 Insert String

A list of Variables which can be used with the Insert String (5.5.3) Tools in the text.

{$Sel}: Variable for the current selection.

{$DateTime}: Variable for the current Date and/or Time, it uses the format defined in the Options Dialog, Page General (8.1).

{$File:<filename>}: Inserts the contents of the file with the name <filename>.

5.3 Using syn as Console Window

You can syn use as a Console Window, and benefit from all additional features syn offers, like AutoComplete, Syntaxhighliht etc. To start an Editor Window in this Mode open a file with .RUN. in the filename. This filename must contain 5 GETTING STARTED 18 informations about the program to use, the current directory of this program and the Exit Command. To use it instead of the Command Prompt the file should look like follows, see also DosConsole.RUN.BAT:

REM CmdLine: %COMSPEC% REM CurDir: C:\ REM ExitCommand: exit REM PrintInput: 0 REM ToOutput: 0 REM AskSaveFile: 0 REM ShowWindow: 0 REM DetachedProc: 0

CmdLine: The Commandline to execute, may have additional arguments, and may contain environment variables.

CurDir: The Workingdirectory for this program.

ExitCommand: The Command to exit this program. If you enter this command in the Editor the Editor window will also close.

PrintInput: Could be 1 or two, test what works best, default is 0.

ToOutput: If 1 the Output from the console program is written to the output list, and not to the same editor window. This way you will be able to make .BAT files interactively, typing every command and seeing immediately its result in Output window. Default is 0.

AskSaveFile: If 1 it will ask you to save the file when closing it, default is 0.

ShowWindow: Specifies how the Window should be shown. Possible values are:

0: The Window is normally shown 1: The Window is hidden 2: The Window is maximized 3: The Window is minimized 5 GETTING STARTED 19

DetachedProc: Ahem, ok here is what the helpfile says: For console processes, the new process does not have access to the console of the parent process. The new process can call the AllocConsole function at a later time to create a new console. This flag cannot be used with the CREATE NEW CONSOLE flag. If 1 it uses this flag DETACHED PROCESS instead of CREATE NEW CONSOLE in CreateProcess. I introduced this , because R runs only with this set to 1. I think Emacs does the same. Send: Any number of lines to send to the console when starting it. Each line should appear in a separate line of the template and should have Send: prefixed.

See also the file DiskPart.RUN.txt and Rterm.RUN.r in the templates\Console directory. It is useful to save such a file with the extension from the Highlighter you want to use, e.g. if I want to run R, I want to use the R Highlighter, and thus it is saved as *.r. Before you open the Rterm.RUN.r you must modify the path to the Rterm.exe program. To easily start such a new session use the “New” Dialog, there is a “Console” Tab with some files. Figure 5 shows a sample session with the DosConsole.RUN.BAT template. For each entered command it creates a Marker, and adds the command to a Recent list, so you can easy jump to entered commands and/or quickly reenter a command. It does not create a Marker when ToOutput is 1, because this wouldn’t be very useful, you would have in each line a Marker. You can show this Recent list with the Key combination Ctrl+Enter. If the Caret is somewhere in the Editor a Return will bring it to the last line. To pause this execution use the Console Execution Menu in the Run Menu. The Default Shortcut for this Button is F2, but you can assign another one if you wish. In that mode editing of whole text is as usual, and pressing Enter works like in any other editor. This could be very useful if you want to add one more console option in the beginning, change current, or edit interactively made *.bat file. If you’ve created such a “RUN” template, and you think this could be useful for other users of syn you should send it to the syn Resource Mailinglist.

Problems: If you want to start a GUI program, such as NotePad with the DosCon- sole.RUN.BAT file it may hung, or you must enter some more Returns. We’re working on it. In the meanwhile you could start the program with the start command, e.g. start notepad, which is AFAIK the usual way to start a GUI programs from a console. 5 GETTING STARTED 20

Figure 5: DosConsole.RUN.BAT Sample session 5 GETTING STARTED 21

5.4 Delphi Form files

Delphi Form files5 are displayed as Textfiles, even if it’s a binary file. If it is a binary file it will be automatically converted, so you can read it. When you’ve opened such a file, and you saved it, it will be converted back into a binary file. You won’t see whether it’s a textfile or a binary file.

5.5 Tools

It’s possible to have custom Tools, which you can call via the Tools Toolbar, the Tools Menu or a Hotkey. You can either launch a Program, execute an Editcommand, insert a String or execute a DOS Command with a Tool. You can assign a Shortcut to each Tool (generally to each Toolbar- and Menuitem) with the Customizedialog. There is no built-in limit how many Tools you can have, but the more tools you have the slower will be the whole program (depending on your Computer). The Projecttools (5.6) are similar to the Tools, which you can configure in the Options dialog, except you can’t assign a Shortcut, and there is no corresponding Menu. To configure this Tools use the “Configure Tools” Dialog (Figure 33), you can show it with the “Configure” Menuitem in the Tools Menu. This Dialog is described in Section 12.4.

5.5.1 Launch a Program

Use “Launch Program” as Toolkind, choose the Program, and the Workingdiretory for this Program. You can redirect the output from console programs to syn like for the Run and Check (5.1) commands, just activate “Capture Console”. There is no possibility to enter a Compilermessage, so you can’t jump to the line with a doubleclick in the list. The file need not be a Program, you can use this method to start any file (e.g. Helpfiles, Documents etc.) with its default program, as well, but if you do so, you shouldn’t check “Capture Console”. For starting the active Document with the associated Program enter as filename the variable for the active Document: “$[ActiveDocShort]”. For a complete list of appropriate Variables for this kind of Tools and “Execute DOS Command”-Tools see section 5.2.1. You should enclose the Programname in Quotes when the filename contains spaces, or use the short filename.

5Delphi Form files are either saved as Binary- or Textfiles, and they have the file extension DFM. 5 GETTING STARTED 22

5.5.2 Execute an Editcommand

Use “Execute Editcommand” as Toolkind, and choose from the dropdown combobox the Editcommand which you want to execute with this Tool.

5.5.3 Insert a String

The string to insert can be a singleline or a multiline string. As Variable for the currently selected Text use {$Sel}. You can use the “Selection” Button to insert this Variable at the current Caret position. Use “Insert String” as Toolkind, and enter the Text to insert in the Textbox bellow. Example for inserting C/Java Brackets:

{ {$Sel} }

Example for inserting HTML Comments:

Use {$DateTime} for the current Date and/or Time, it is formatted according to your settings for Date/Time Format in the Options Dialog Page “General” (8.1). You can use the {$File:filename} Variable to insert the contents from a file, you’ve to replace “filename” with the name from the file to insert. It is only useful to insert textfiles of course, but you know this. For a complete list of these Variables see section 5.2.2.

5.6 Projects

Projects are saved as ordinary ini files, but with the extension “syp”, you can read and modify them with any Texteditor. You should know what you’re doing when you modify such a file manually, of course. If you have used the Installer *.syp files are associated with syn, so you can open such files with a doubleclick in the Explorer. You can also drag a projectfile from the Explorer and drop it into the program to open it. As any 5 GETTING STARTED 23

INI file shouldn’t this file exceed the 64 KB limit as well, everything exceeding this limit is truncated. Anyway, it will have to be a very large Project to exceed this limit. The Filenames are saved with relative paths, i.e. when you move a Projectfile without all its members to another folder the Program will not find the Files. You have to remove all files and add it again to the project. There are two Menuitems in the Project-, the Editor- and the Contextmenu from the Workspace (“Add to Project”, “Remove from Project”), this Items are not visible when no Project is opened. I don’t want to bother myself with Menus I can’t use (Menus are growing that fast!). This information is just in case, you think what a stupid Office 2000 behavior. There are no other Items, which are sometimes invisible, except the Recent Files Menu when it contains no files and the Tools Menu and Toolbar when no Tools are configured, but this is usual behavior.

“Add to Project” Menu: The submenu lists all opened documents which are not already members of the current project. If you click on one, this file will be added to the current project, no need to open the Project Options. The Menuitem “Add all” adds all listed Files to the project. Only files with a filename are listed, i.e. files which has been already saved.

“Remove from Project” Menu: The submenu lists all files which are members of the current project, to remove one file from the project click on the corresponding Menuitem.

Why an Up- and Down-Button at the Filespage? Because the file at the bottom will be loaded as last file, and will be the active one.

Project Tools: It’s possible that each project has its own Tools. This Tools acts similar as the usual User Tools (5.5), which you can setup in the Options dialog. To configure the Project Tools use the Projectoptions Dialog, Page Tools.

Limitations for Projecttools:

• You can’t assign a Shortcut to this Tools, because they are generated dynamically.

• There is no corresponding Menu. 5 GETTING STARTED 24

5.7 Monitor for external changes

This program is able to monitor opened files for changes made by an external program (default is disabled). The program compares the last write date to detect whether the file has changed or not, not the string inside or the filesize. This means, you can save a file with another program without changes, and syn will do the requested action. This should be the way to notice the most changes, because you can have different files with exact the same filesize, and comparing the filecontent will take to much time and resources (the program must open the file, read the content, and compare it). The program uses the “FindFirstChangeNotification” et al. API functions in an external to detect changes in the directory from an opened document, and compares then the filedate. This thread isn’t created when you’ve deactivated this feature. You have three options for what this program should do in such a case:

1. Notify only: the program shows only a MessageBox.

2. Prompt to reload: the program asks you if the file should be reloaded, to get the newest version. Note: all made and not saved changes will go lost, if you reload the file. On the other hand if you save it before reloading, the made modifications from the external program will go lost.

3. Reload without prompting: the program reloads the file without to ask you anything, be careful with this, you might be scared in such a case ;-).

The status is displayed in the Statusbar (7.12).

5.8 Limit to one Instance

If this option is activated, and you want to launch a second instance of syn, the pa- rameters passed to this second instance will be processed by the first instance, and the second one terminates itself. This means you’re not able to run syn more than only one time. This can be useful in some cases, especially when you’re using the SynTray (18) Program. This option is activated by default, because some features rely on it, but it’s also not problem when you deactivate it. This is possible at the General Page (8.1) in the Options Dialog. 5 GETTING STARTED 25

5.9 Generating PDF Files

There are no plans to add an exporter for PDF (Portable Document Format) files in the near future, but you can do it with a small Workaround: There is a Freewaretool which converts HTML files into PDF files called HTMLDOC6 . So you can export the file to a HTML file (which is supported by syn) and convert it with HTMLDOC into a PDF file, looks pretty cool. HTMLDOC supports most, or even all (?), of the HTML 3.2 Tags. I know there is a Unit for Delphi and Pascal, which can write PDF files natively, but the filesize from syn would increase dramatically, and the Acrobat Reader says for all files, I’ve generated with this Unit, that it is corrupt. If you have Acrobat installed, you can use the Acrobat Distiller Printerdriver directly from syn (“File” → “Print. . . ”) as you would do with each other Program. You can also print to a Post Script Printer7, and then convert it with GhostScript8 to PDF, which is completely free, and looks also quite good.

5.10 The Custom Highlighter

There is one highlighter, which you can use for a custom Syntaxhighlight, it’s called “Custom Highlighter”. You can use it as an usual highlighter, but the definitions comes from a file, which must be in the Application path, and it must have the name “syn- high.ini”. You can read and write such files with any Texteditor like Notepad, or even syn. Besides a list of keywords you can also define a list of constants and objects that can have their own highlighting attributes.

5.10.1 Fileformat

[General] 6HTMLDOC is a free Tool, covered under the GPL, for converting HTML files into Acro- bats Portable Document Format (PDF) or to PostScript Files (PS), you can download it at: http://www.easysw.com/htmldoc/. 7You can use from HP a PostScript Printertdriver, take for Windows NT and 2000 http://www.hp.com/cposupport/printers/software/lj485en.exe.html, and for Windows 95 and 98 http://www.hp.com/cposupport/printers/software/lj477en.exe.html. These are drivers for HP color laserjet 4500, which seems to work well with GhostScript. 8You can download it from ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs703/gs703w32.exe. 5 GETTING STARTED 26

; The Name of the Language LangName=SomeName

; Use this section to define the style for Comments, use ‘‘true" or ; ‘‘false" for matching items, default is false. [CommentStyle] ; ANSI styled comment: (*comment*) ansi=false ; ASM styled comment: ;comment asm=false ; Bas styled comment bas=false ; C(++) styled comment: /*comment*/ c=false ; Pascal styled comment: {comment} pas=false ; Visual Basic styled comment: ’comment vb=false ; Perl styled comment: #comment perl=false

; Delimiter in which strings are enclosed, this can either be a single ; quotemark (’), a double quotemark (") or both. Use true for matching ; items. [String Delimiter] Double Quotes=true Single Quotes=false

[Switches] markup=false ; When markup is true, words between < and > will be highlighted. ; You can use this for markup languages like HTML, XML and XSLT entity=false ; When Entity is true entity symbols like & will be highlighted. ; You can use this for e.g. HTML and XML highlighting. dollarvariables=false ; When DollarVariables is true symbols preceeded by the sign will be ; highlighted using the VariableAttri settings. You can use this for 5 GETTING STARTED 27

; variable highlighting in languages like php and perl ActiveDot=false ; When ActiveDot is true properties and methods of objects after the dot ; are highlighted, e.g. myobject.method

; List all Objects here [Objects] object1 object2 ...

; All Constants goes here [Constants] constant1 constant2 ...

; Enter here all Keywords [Keywords] key1 key2 ... This is all, Settings for this Highlighter are saved to the registry as usual, and not to this file. You can setup the colors, styles and associated Filetypes in the Optionsdialog. The program loads this file at startup, if you’ve changed it, you’ll need to restart the program to see the changes.

5.11 Autocomplete

This Program offers a feature to complete codefragments with hitting a Hotkey. The informations about how to complete the code comes from a file, which you have to configure in the Options Dialog → Syntaxhighlight → Autocomplete (8.11.2), you can edit this Templates in the Options Dialog, or you can use a Texteditor. You can define the Hotkey in the Optionsdialog page Shortcuts (8.16) command ecAutoCompletion (default is Ctrl+J, but I prefer Ctrl+Space in this case9). 9Ctrl+Space is usually the Hotkey for Code Completion, hence syn doesn’t support any intelligent 5 GETTING STARTED 28

The fileformat is the same as Delphi uses for this feature, it’s an ordinary Text file. If you have Delphi, and you’ve your own file made for Delphi, you can just assign this File instead of the shipped file. You can also use the “bsb.dci” file from C++ Builder for the C++ Language, it’s the same fileformat. This file can be found in Borland\CBuilder4\bin, delphi32.dci can be found at Borland\Delphi5\bin, depends on the version you’re using.

5.11.1 Example for Object Pascal

// will insert an Array declaration when [arrayd | array declaration (var)] // you enter ‘‘arrayd" and then hit the Hotkey array[0..|] of ;

// will insert a case Statement when you [cases | case statement] // enter ‘‘cases" and hit the hotkey. case | of :; :; end;

The first line enclosed in brackets is not inserted, this line is used to identify the code. The first part is the short form and will appear in the “Name” Column in the ListView from the Options Dialog. The second part behind the “|” Character is a short description from this code, you’ll see this part in the “Description” Column in the ListView. You can make or edit such a file with any Texteditor (e.g. Notepad) but it is probably easier for you to use the Options Dialog (8). It’s possible to edit this file “visually” at the Syntaxhiglight Page (8.11.2), see Figure 22.

Note: You can’t use the combination “[|]” in the code section, because the program will think this is a header line from a code section. It will tell you that this is an invalid fileformat, and maybe some more errors. kind of code completion, I use this Hotkey for the Autocompletion feature (Space is easier to find than J). 5 GETTING STARTED 29

The Caret will be placed where the “|” Character is in the code. Example: If you have a Pascal Document and you have assigned “pascal.dci” as Auto- complete file in the Options Dialog then enter e.g.: cases into the Editor, hit the Hotkey, and you’ll get: case | of :; :; end;

The “cases” will be replaced with the case statement. Made changes will only affect new opened files, not already loaded files. You have to use a Highlighter in order to use this feature, it’s not possible to use it, when no Highlighter is assigned. The Autocomplete files shipped with the Setup Program will be assigned during Install to the Highlighter. You can make, of course, for any supported Syntaxsheme such a file and assign it to it, it’s not limited to ObjectPascal and HTML. The Program will load this file when the Highlighter is assigned to the document, e.g. due to loading or saving a document, or switching between the Highlighters. If you’ve created such a file, or more of them for a language, and you want that I put it on the syn Page for download for other users, send it by Mail to me. I recommend you to make this list not too large because this may slowdown some processes. I would only add the most frequently used Code snippets, but this is completely up to you and your computer, there is no built-in limit.

5.11.2 Popup List

If the insertion from a Code Template fails for some reason, e.g. you haven’t entered a Token, or it doesn’t find a matching Token, it will show a Popup List with all the Code Templates for the current language. You can choose from this List a Template and insert it with a double click on the Item in the List, or with hitting the Enter Key. To hide the List use the Escape (Esc) Key. The Autocomplete List shows the short form right aligned and bold, the Description is left aligned, it is very similar to Delphi. This list is not sorted, you can make an order of your choice in the file. 5 GETTING STARTED 30

Figure 6: Autocomplete List

This List has also a Quicksearch, like any usual ListBox and other similar Controls (ListView, TreeView etc.), but it doesn’t search for the description, but for the Label (the right aligned Part from a List Item). For example, you hit the Key “C” on the list, the next Item with the Label starting with a “C” will be selected. If it can’t find any more Labels beginning with a “C”, it will start searching from the begin.

5.12 Editcommands

Some commands to edit the selected text or the entire Document.

5.12.1 Uncategorized Commands

Undo: The Undo command reverses whatever you just did concerning the editor. When Undo is disabled, it is an indication that nothing needs to be undone or you cannot undo the last action.

Redo: If you undo a little too much, choose undo to un-undo! 5 GETTING STARTED 31

Cut: This command cuts the currently selected text to the clipboard.

Append Cut: Cuts the Selection and appends it to the Clipboard.

Copy: Copies the selected text to the clipboard.

Append Copy: Copies the selected text and appends it to the clipboard.

Paste: Choosing this command copies the clipboard contents at the cursor, or replaces the selected text with the clipboard contents.

Delete: The delete command clears the selected text from the active document or it removes the selected item of the File View.

Select All: This command selects everything in the active document.

Check Spelling: Checks the active document for spelling errors.

Insert Date/Time: Inserts the current date and/or time at the caret position, to setup the format use the Options Dialog, Page General (8.1).

Insert File: Inserts the contents of a file into the active document, at the current Caret position.

Modified: Toggles the Modified status of the active document.

Read only: Toggles the read only status of the active document on and off (Read Only is displayed in the status bar). A read only document cannot be modified.

5.12.2 Fomat

Commands to format the entire document.

Tabs to Space: Replaces the Tabs in the entire Document with the specified count of Spaces.

Space to Tabs: Replaces the specified count of Spaces in the entire Document with Tabs.

Leading Tabs to Space: Replaces all Tabs at the begin of a line with Spaces in the entire Document. 5 GETTING STARTED 32

Leading Space to Tabs: Replaces all Spaces at the begin of a line with Tabs in the entire Document.

OEM to Ansi: Translates the entire Document from the OEM character set into the ANSI character set. It’s not possible to undo this command, use the Ansi to OEM command instead.

Ansi to OEM: Translates the entire Document from the ANSI character set into the OEM (original equipment manufacturer) character set. It’s not possible to undo this command, use the OEM to Ansi command instead.

Encoding: Allows to convert the active Document to different Codepages.

Trim trailing Spaces: Removes all Spaces at the end of a line in the entire Document.

5.12.3 Change Case

Commands for changing the case from the Selection.

Upper Case: Changes the Letters from the Selection into upper case.

Lower Case: Changes the Letters from the Selection into lower case.

Invert Case: Inverts the case from the Selection.

Capitalize: The first Letter from each word is upper case, all other Letters are lower case.

Sentensize: The first Letter from each sentence is upper case, all other Letters are lower case. It looks for a punctuation mark (.?!;: etc.) and then for a Whitespace (e.g. Tab, Space), i.e. there must be a Whitespace after the punctuation mark.

5.12.4 Block

Commands for editing the selected Block.

Increase Indent: Increases the indentation from the selected line(s).

Decrease Indent: Decreases the Indentation from the selected line(s). 5 GETTING STARTED 33

Comment: Comments the selected block according the Syntaxsheme. Select the Com- ment Character and Style in the Options Dialog, Page Syntaxhighlight (8.11.1). Use for the selected text the “|” Character. If there is such a character the pro- gram handles it as multiline comment, if it’s not a multiline comment (like in VB, “’”) use not this Character. Uncomment: Uncomments the selected block according the Syntaxsheme. It uses the same settings as for the “Comment” command described above. Sort: Sorts the selected lined lines alphabetically. Save: Saves the selected Block to a file.

5.12.5 Advanced

Some advanced Editcommands, sometimes useful but not often used.

Delete Lines: Deletes the whole lines beginning where the Selectionblock begins, and ending where the Selectionblock ends. Delete to BOL: Deletes the Text from the Textcaret to the begin of the line (BOL). Delete to EOL: Deletes the Text from the Textcaret to the end of the line without the Linebreak (EOL). Delete Word: Deletes the whole word under the Textcaret. Select Line: Selects the whole line (with the Linebreak) where the Textcaret is. Select to BOL: Selects the Text from the Textcaret to the begin of the line (BOL). Select to EOL: Select the Text from the Textcaret to the end of the line without the Linebreak(EOL). Select Word: Selects the whole word under the Textcaret. Join Lines: Writes the selected Lines into one line (it removes the Linebreak). Split Line: Breaks the line at the Caret Position without indenting. Duplicate Lines: Duplicates the line where the Textcaret is, and inserts it as the next line. Format Lines: Breaks the line at right Edge. 5 GETTING STARTED 34

Figure 7: Search Text Dialog

5.13 Searchcommands

As already mentioned offers syn some powerful Searchcommands, like Find in Files (5.13.4), Incremental Search (5.13.3), Find next/previous Word (5.13.2) etc. Here is a more or less detailed explanation from this commands.

5.13.1 Find

The Find command shows the Search Text Dialog (Figure 7), in which you can enter a Text you want to search for. Press Enter to search the active document for the specified string. The selected word in the Editor is in the Findtext field, when there are more lines selected, nothing is in the Findtext field, but the CheckBox Selected Text only is selected. If you activate “Mark all Matches” it sets a Marker for each Match, and doesn’t highlight the Match. You can jumt then to the Match with a double click in the Marker List or with the Marker Contextmenu.

5.13.2 Find next/previous Word

Searches for a next or previous match from the currently selected text, without the need to open the Search Text Dialog and entering some text. 5 GETTING STARTED 35

5.13.3 Incremental Search

The Incremental Search functions search for a text while you are typing it into the Editor. You can see the current Searchstring in the Editor State Statusbar Panel, see section 7.12 for more informations about the Statusbar. A matching string is selected in the Editor. To exit the Incremental Search Mode hit Escape (Esc) or Enter. To switch to the search mode use either the “Incremental Search forward” or the “Incremental Search backward” Menuitem in the Search Menu, depending in which di- rection you want to search.

5.13.4 Find in Files

It is possible to search for a String in multiple files. To do so, use the “Find in Files” Menuitem in the “Search” Menu. A Dialog (Figure 8) will appear where you should enter the search criteria. After clicking “Find” the Output Window (Figure 9) will show up, and all Matches are written to the List. To jump to the match just double click on the item in the list. This will open or activate the file and places the Caret in the line where the match was found. It is also possible to replace occurrences of the search string with another string. If you replace Text binary files are automatically skipped, because it can’t correctly replace text in binary files. Before you replace text in files you should make a backup copy of these files. If you want to list only all files in a certain directory, which maches the filenamsk, then leave the “Find what” Textfield empty. See also Section 19. This Tool also supports Regular Expressions, to learn more about Regular Expres- sions see 16. To use Regular Expressions check the CheckBox “Regular Expression”. If you check “Output in Pane 2” matches are written to the second list (“Find in Files 2”) rather than in “Find in Files 1”. In the “Scope” GroupBox you can choose where and which files should be searched, check “Search in Folder” to search in the Folder entered in the “In Folder” ComboBox, “Look in Subfolders” to search all subfolders, “All open Files” searches all files which are currently opened, and “All Projectfiles” searches all files in the currently opened Project. The Filefilter is also used for this files, e.g. you’ve the Filefilter “*.htm”, only HTM files from your Project- or open files will be searched. To search in all files use “*.*” as Filefilter. 5 GETTING STARTED 36

Figure 8: Find in Files Dialog

Figure 9: Find in Files Search Results 5 GETTING STARTED 37

Figure 10: Replace Text Dialog

5.13.5 Replace

This command shows the Replace Text Dialog (Figure 10) where you can enter the Text which should be replaced, and the Text with which it should be replaced. If you use “OK” you’ll see the Confirm Replace Dialog (Figure 35), which asks you whether you’re sure every time it finds a match. If you use “Replace all” every found match will be replaced without asking you anything. If you have activated “Report Count” it tells you how many occurrences has been replaced. You may also use Escape Sequences (17) for replace text, such as \n, \t, \f, \r, to replace some text with such a nonprintable character.

5.13.6 Go to

Shows the Goto Dialog (Figure 11), you can jump with it easily to a Line- or Column- number or a Bookmark, if any set. The cursor is displayed at the specified line-, column- number or Bookmark. It is also able to parse the Output from a Program started with the Run Command, based on the Output Expression, or a Find in Files Search Re- sult. If you choose such an Item, you can open this file and jump to the Line- and Columnposition. 5 GETTING STARTED 38

Figure 11: Goto Dialog

5.13.7 Goto previous/next Output Item

Goes to the next or previous item in the Output or Find in Files list. This is useful if the Output is a mess, and it’s not easy to identify a Line which matches the Output Expression, e.g. like LaTeX output. It uses the currently selected Item in the List and iterated through the rest to find such a Match. If it finds a matching Item it selects it in the Output or Find in Files list.

5.13.8 Go to last change

The cursor is moved to the line were you made the last change to the text. This may be useful when you’ve a large Document, and you scrolled to anywhere just for looking, and want to jump now back.

5.13.9 Show Caret

Scrolls the Editor to bring the Caret into view.

5.14 Using Ctags syn directly supports the Ctags program to obtain a list of functions, procedures and other declarations from the active Document. This program is not included in the dis- tribution of syn, you may need to download it from http://ctags.sourceforge.net/. Once 5 GETTING STARTED 39 downloaded this file put the ctags.exe into the directory of syn, or make an Environ- ment variable named CTAGSBIN which points to the location of the Ctags executable. Now it should call this program automatically, and fill a Combobox with all found informations in a Toolbar.

Where does it look for Ctags?

1. It looks if there is an Environment Variable CTAGSBIN, if it finds there the Ctags executeable it uses this.

2. Then it looks for ctags.exe in your PATH Environment.

3. At last it looks in the program directory of syn for the Ctags executeable.

Ctags runs in a separate Thread with Idle (lowest) priority, this makes it possible that you need not wait until the file is parsed, but Ctags will also be slower, and may take some time on larger files. You shouldn’t even notice that this program is running in the background, because this way it does not consume much system resources. Ctags is called everytime an Editor gets activated or a file saved. You may pass for each Language individual options to the Ctags Program, e.g. --sort=no would be useful for certain languages, see section 8.11.5 how. What options this could be see the Ctags documentation.

An Item in the Tags Combobox may look like this: f (2598): CppParser e ( 136): DECL_BASE (enum:eDeclaration;file:)

To the first Item: The first f means this Tag is a “f” Type, a function. The number in the parentheses is the Linenumber, the word after the colon is the Name of the Tag, e.g. the Name of the function.

To the second Item: The first character is again the Type, in this case an Enum, then there is the linenumber, then the Name, and the last part in parentheses is the extended field. 5 GETTING STARTED 40

5.15 Calling a Helpfile depending on the Syntax Sheme

You can call different Helpfiles depending on the selected Syntaxsheme. To do so assign any Helpfile in the Options Dialog (Highlighters Page, 8.11.4) and hit the F1 Key in the Editor. To change the Hotkey to another one, use the Options Dialog → Page Shortcuts (8.16), and modify the command “ecContextHelp”. This will launch the Helpfile, and if it is a *.hlp or a *.chm File it will search the Word under the Caret in the Index and shows the topic when it’s found. If there is no Word under the Caret it will show the Contents Page from the Helpfile. If you don’t want to search the Token under the Caret in the Index, but call a specific Topic for a specific Word, you can make a Table on which Token which Topic should appear. Open the Options Dialog, go to the Highlighters Page (8.11.4), choose Help, and enter in the “Map Table” List the associations. In the first column should the word appear, in the second the numeric Topic ID. Sure, this makes only sense, when you know the Topic ID’s for the different Topics. This works for *.hlp and *.chm files only. Is it not a *.hlp or a *.chm file it will just use the ShellExecute API function to show the file with the default program, e.g. the Browser for HTML files.

5.16 FTP

You can open and save files directly from a FTP server, if you wish to do so use the commands “Open from FTP” and “Save to FTP” in the “File” Menu. After using one of this commands a Dialog (Figure 12) will appear where you’ll have to enter your Login Data and some other stuff. If you open or save a file in this way the setting are saved to the registry, and you can use them the next time without entering them again. To edit this settings use the Option Dialog Page FTP Server (8.8). The program will show a Window during the up- or download process to indicate, that it is currently up- or downloading a file. The downloading process is not asynchronous, this means the program is blocked this time, and you can’t use it.

Warning: The passwords are saved to the registry using a simple cryption algorithm. To prevent saving the Password to the Registry uncheck“Save Password”(default).

To open a file from a subdirectory on the Server enter in the Filename Textbox the filename with the subdirectory, e.g. “subdir/file.txt”. If you want to open a file in 5 GETTING STARTED 41

Figure 12: Save to FTP Dialog 5 GETTING STARTED 42 the root directory, it is possible that you will have to enter a leading slash before the filename, e.g. “/index.htm”. When you upload a file, the file in the Editor will be saved as a temporary file in the Temp directory ({temp}\synupload.tmp), and the program will upload this file, this means, you need not save the file before locally. This file will be deleted after the uploading process. If you’re transferring text files between Unix and Windows using FTP be sure to transfer them in ASCII mode so the ends of lines are appropriately converted. To browse on the FTP Server for a file use the“Browse”Button (. . . ) from this dialog. This button shows a Browse Dialog (Figure 13) similar to the Open/Save dialogs from Windows. You can create directories, delete and rename files, or just select a file. It is not possible to delete or rename a Directory, for advanced FTP commands use a FTP Client, or, if you’re familiar with the FTP Commands, use Send Command. You can send any command to the FTP Server, if you add or remove a file/directory, you’ll have to refresh the list, to see it (Contextmenu from the ListView → “Refresh”, or F5 ). The program stays connected to the FTP Server during browsing, but it logs out after uploading or downloading a file. This should make browsing much faster, and I think it’s not necessary to stay connected after up- or downloading a file. Staying connected would cause some other problems too, e.g. the FTP server logs you automatically out after a specific time of inactivity, the program has to send a command (NOOP) to prevent this, not every Server accepts this command and this works not for an unlimited time, etc. When you’re connected with the Browse Dialog, and you’re not using it for a long time, you may also be disconnected, which will give you an Errormessage, when you try to access the Server again. You can use the “Reconnect” Command (F3) to find in the Popup Menu from the ListView in such a case to connect to the Server again.

5.17 File Explorer

The File Explorer is similar to the folder tree in the Windows Explorer, with the differ- ence that this one shows not only the folders but the files as well. This has the advantage that there is no need for an additional ListView for the files. The File Explorer is initially invisible, this means when you start this program the first time you can’t see it, to show it use the “File Explorer” Menuitem in the View Menu (6.4) (submenu Toolbars). 5 GETTING STARTED 43

Figure 13: FTP Browse Dialog 5 GETTING STARTED 44

Note: Showing the File Explorer will slowdown the startup process from the program, because there are some fileoperations involved.

The File Explorer has initially the Current Directory from syn, if you want to have an other Directory, change the Workingdirectory at startup. To change the Workingdi- rectory you’ll need to launch syn from a Link. The File Explorer does not notice changes, e.g. deletion or creation from files, in the filesystem. You can update the Explorer with the F5 key, or with the “Refresh” Menuitem in the Popup Menu. You can change this Shortcut in the Customize Dialog (“Keyboard” → Category “View” → “Refresh”). To open a file from the File Explorer just double click with the mouse on it, or use the Popup Menu, it appears when you rightclick on a File or Directory. You can also select a File and hit then Enter. It is not possible to select more than only one File, and open them at once.

5.18 Bookmark Files syn saves by default Caret position, Marker and selection of a Document before you close this Document, and restores it when you load this Document again. These files have the extension .sbm and are hidden by default. You can disable this behaviour in the Options Dialog (8), Page General (8.1). If you want that it does not save such a file when closing a certain Document, then hold the Keys CTRL and SHIFT down. This file is not created, or it is deleted when one exists when:

1. There are no Bookmarks set and

2. the Caret is in the first line and the first column

i.e. one of this items has not the default value. It does not care about the value of the Top Row when the above mentioned items has the default value. 6 MENUS 45

6 Menus

This is a short description from the Menus you can find in syn. The most commands are described on other places, hence this is not a exhausting description from the commands, but you’ll find here some references.

6.1 File Menu

New: Creates a new document or shows the New Dialog (Figure 30).

Open: Shows the Open Dialog to open a file. The Submenu contains the recently used filelist.

Open Next: Opens the next file, if there is one.

Reopen file: Reloads the file, all made and not saved changes will go lost.

Save: Saves the active document.

Save As: Saves the active document under a different filename.

Save all: Saves all opened documents.

Open from FTP: Downloads a file from a FTP server.

Save to FTP: Uploads a file to a FTP server.

Export: Exports the active Document to a HTML or RTF. This Menuitems are only available when a Highlighter is assigned to the active Document.

Close: Closes the active Document.

Close All Files: Closes all opened Documents.

Properties: Shows some properties from the active Document.

Print: Prints the active Document to a Printer.

Print Preview: Choose this command to display the print preview of the file with the focus. 6 MENUS 46

Page Setup: Shows a Dialog (Figure 23) to configure Printmargins (9.1), Printheader and -footers (9.2) etc.

Exit: Closes the program.

6.2 Edit Menu

You’ll find a description from the Editcommands in section 5.12.

6.3 Search Menu

You’ll find a description from the Searchcommands in section 5.13.

6.4 View Menu

Toolbars: Displays a list of toolbars and Toolwindows which can be toggled to show or hide.

Status Bar: Shows or hides the Status Bar.

Syntax Schemes: Switches between Syntax Schemes.

Fullscreen: This command hides the menubar, statusbar and all the non-floating tool- bars, giving you your entire screen as the main working area. To go back to normal view use the Hotkey (default F11) or the Fullscreen Menuitem in the contextmenu from the Editor.

Show Linenumbers: Shows or hides the Linenumbers from the Editor.

Show Whitespace: Shows or hides Characters such as Spaces, Tabs or Linebreaks.

Options: This command displays the Option dialog (Figure 21) box for changing op- tions and settings which are related to syn itself. The options are described in section 8. 6 MENUS 47

6.5 Project Menu

New: Creates a new empty project, before you’re forced to choose a filename for the project.

Open: Opens an existing project. The Submenu contains recently used Projects.

Close: Closes the current Project, and all files belonging to this Project.

Add to Project: Shows a list with currently opened files, which you can add quickly to the current project.

Remove from Project: Shows a list of files which are currently a member from the open project to remove them.

Sort Files: Sorts project files alphabetically.

Options: Shows a dialog to configure some options, for more informations see 11.

6.6 Run Menu

Parameters: Shows a Dialog (Figure 29) to add quickly Arguments to the commandline without changing the syntax or project settings.

Run: Starts the program with the arguments you’ve defined either in the Options, or Projectoptions as Run program.

Check: Starts the program with the arguments you’ve defined either in the Options, or Projectoptions as Check program.

Stop Process: Terminates a running process you’ve started with the Run, Check com- mands or a Tool.

6.7 Script Menu

Execute: Shows the Open dialog to load a Script and executes it.

Run Active: Runs the active Document, assuming it is a Script. It takes directly the Text in the Editor, so it’s not necessary to save it before. 6 MENUS 48

6.8 Tools Menu

This is the Menu for the Tools you’ve configured. If you haven’t configured any Tools yet, you won’t see this Menu. More informations about Tools are in section 5.5.

6.9 Window Menu

New Window: Creates a new window with the Text from the active window.

Close: Closes the document window that has focus. If the document has been modified, you will be prompted to save it.

Close all: Closes all document windows. If any document has been modified, you will be prompted to save it.

Previous: This command brings the previous document to the front.

Next: This command brings the next document to the front.

Cascade: This command arranges all the windows in the main working area in the familiar cascade pattern.

Tile Horizontally: This command arranges all the windows in the main working area so that each is the full width of the working area.

Tile Vertically: This command arranges all the windows in the main working area so that each is the full height of the working area.

Minimize all: Minimizes all opened windows.

Arrange Icons: This command arranges minimized windows at the bottom of the window.

Windows: Opens the Windows Dialog (Figure 37), where open documents can be activated, saved, closed, cascaded, tiled or minimized. 6 MENUS 49

6.10 Help Menu

Contents: Shows this Manual, or when you haven’t it yet downloaded, it will ask you whether you want to download it now.

Keyboard Map: Shows all keyboard commands, you can see the default commands in section 13.

Email Support: Send an Email to Stefan, when you have some problems to get help. syn on the Web: Some useful Internet addresses regarding syn.

Versions: Show the versions from some files, which syn uses sometimes.

About syn: Shows Copyright and Version information, and a nice Bitmap :-).

6.11 Editor Popup Menu

The Popup Menu (Figure 14) provides mainly some Edit commands, but also important search commands, and the “Fullscreen” command. If you have a project open it will have two more Menuitems, “Add to Project” and “Remove from Project”. To show this Menu use the right Mouse Button in the Editor.

6.12 Window Bar Popup Menu

This Menu (Figure 15) gives you a quick access to some window related commands, even when this window is not active. You can close, minimize, save etc. it. To show this Menu use the right Mouse Button on the desired Window Tab. If you click with the right Mouse Button on the Window Bar, but not on a Button, you’ll show the Window Menu (6.9).

6.13 Workspace Popup Menu

To show this Menu use the right mouse button in the Workspace Window. The Project Explorer Popup Menu contains mainly Items which can also be found in the Project Menu (6.5). It has additionally two more items: 6 MENUS 50

Figure 14: Editor Popup Menu 6 MENUS 51

Figure 15: Window Bar Popup Menu

Open: Opens the selected file. Alternatively you can use a doubleclick on a file, or use the Enter Key. Hide: Hides the Workspace Window.

6.14 File Explorer Popup Menu

To show this Menu use the right mouse button in the File Explorer. The File Explorer Popup Menu (see Figure 18) contains only three Items:

Open: Opens the selected file. Alternatively you can use a doubleclick on a file, or use the Enter Key. Refresh: Refreshes the Explorer, in case you’ve deleted or created files. Hide: Hides the File Explorer.

6.15 Output Window Popup Menu

To show the Popup Menu from the Output Window (Figure 16) use the right mouse button in one of the Lists. All Lists in the Output Window have the same Menu, but 6 MENUS 52

Figure 16: Output Window Popup Menu the commands may act in different ways depending on which List is visible.

Jump to Line: When you’ve started a program with the Run or Check command which emits a linenumber, e.g. an Errorline from a compiler, you can jump with this command to the line. When it emits also a filename this command will also open or activate the file. For more information see section 5.1. You can jump to a searchresult from Find in Files in the same way.

Goto previous/next Output Item: are the same commands as described in Section 5.13.7.

Clear List: Clears the List.

Copy all: Copy the entire List to the Clipboard.

Copy Line: Copy the selected line to the Clipboard.

Save to File: Saves the entire list to a Textfile.

Hide: Hides the Output Window.

6.16 Marker Popup Menu

This is the Popup Menu of the Marker List. You can show it with a Right click on a Marker in the List. 6 MENUS 53

Figure 17: Popup Menu for the Marker List

Jump to: Opens the File and places the Text Caret at the position of the selected Marker.

Add Marker: Shows the Marker Dialog (12.7, Figure 36) to add a new Marker.

Edit Marker: Shows the Marker Dialog to edit the selected Marker.

Priority: Sets the Priority of the selected Marker.

Delete Marker: Deletes the selected Marker. 7 TOOLBARS 54

7 Toolbars

This section describes the Toolbars and Toolwindows you can find in the main window from syn. You can drag and dock all this Toolbars and -windows to where you want. The program should restore your layout at startup.

7.1 Main Toolbar

The Main Toolbar is probably the Toolbar with the most frequently used commands. It contains some important File (6.1), Edit (5.12) and Search (5.13) Commands.

7.2 Project Toolbar

The Project Toolbar contains only tree Buttons:

New Project: Creates a new empty project. It prompts you to choose a filename for the project.

Open Project: Opens an existing project, before you’re prompted to choose a file- name.

Projectoptions: Shows a Dialog (11) to setup some project settings.

7.3 Run Toolbar

The Run Toolbar contains the same Commands as the Run Menu (6.6).

7.4 Edit Toolbar

This Toolbar contains some Edit Commands.

7.5 Script Toolbar

The Script Toolbar contains the same Commands as the Script Menu (6.7). 7 TOOLBARS 55

7.6 Tools Toolbar

The Tools Toolbar contains all configured Tools, to learn more about Tools and how to configure see section 5.5. This Toolbar and the Tools Menu is only visible when there is at least one Tool configured.

7.7 Window Toolbar

The Window Toolbar contains some Window (6.9) Commands.

7.8 File Explorer

The File Explorer (Figure 18) gives you a quick access to local files. It is similar to the TreeView from the Windows Explorer, but it shows also all files, not only the folders. For more informations refer to 5.17. To show or hide the Window Bar use the “File Explorer” Menuitem in the “View” Menu (6.4).

7.9 Worspace

The Workspace (Figure 19) shows all currently opened files, categorized to whether a file is a member from the current Project or an “External File”. To open or activate a file double click on a file in the TreeView, or use the Popup Menu. To show or hide the Workspace Window use the “Workspace” Menuitem in the “View” Menu (6.4). The Workspace Window appears automatically when you load a Project and you’ve activated “Show Workspace when loading this Project” in the Project Options.

7.10 Output Window

The Output Window shows the Output from a Console Program (Figure 1) you’ve started with the Run, Check Commands or a Tool, when you’ve activate “Capture Console”. For more information refer to 5.1 or 5.5. It shows also the search results from the Find in Files (Figure 9) program, more about Find in Files is in section 5.13.4). To show or hide the Output Window use the “Output Window” Menuitem in the “View” Menu (6.4). The Output Window appears automatically when you start a Tool, when you use the Run or Check commands, or you start the Find in Files program. 7 TOOLBARS 56

Figure 18: File Explorer 7 TOOLBARS 57

Figure 19: Workspace 7 TOOLBARS 58

7.11 Window Bar

The Window Bar is similar to the Task Bar from Windows, it shows all Open Windows, and you can active one with selecting a Button in the Window Bar. It has also a Popup Menu with some Document and Window related Commands. When you invoke the Popup Menu using the right Mousebutton, the window is not activated, but the Commands applies to the Window from the Button under the Cursor. The “Show Active” Menuitem in this Popup Menu scrolls the Tabs to the Button from the active Window, when there are to many Buttons to display them all on the Bar. If the Font of a Button has another color than Black this means this document has been modified. To show or hide the Window Bar use the “Window Bar” Menuitem in the “View” Menu (6.4).

7.12 Status Bar

The Status Bar (Figure 20) shows some status informations, which may be useful some- times. To show or hide the Status Bar use the “Status Bar” Menuitem in the “View” Menu (6.4).

First Panel: Shows a short help text when you move the Mouse over a Control, e.g. a Menuitem or Toolbar Button.

Second Panel: Shows the current Caret position. Doubleclick on it to show the Goto Dialog.

Third Panel: Shows the current Linebreak. Doubleclick on it to change the Linebreak.

Fourth Panel: Shows whether the active document has been modified or not. Dou- bleclick on it to toggle the Modified Flag.

Fifth Panel: Shows the editorstatus, it can have the text“Insert”,“Overwrite”for insert or overwrite mode, “Read Only”, when the document is read only and “Search . . . ” when you’re in Incremental Search (5.13.3) mode.

Sixth Panel: Shows the status of monitoring for external changes, for more informa- tions see Section 5.7.

Green: It does monitoring. Gray: Monitoring is disabled. 7 TOOLBARS 59

Figure 20: Status Bar and Window Bar

Red: It does not monitoring, this could be when the file does not exist.

Seventh Panel: Indicated whether a Process is currently running which you’ve started with the Run, Check commands, or a Tool. 8 PROGRAM OPTIONS 60

Figure 21: Options Dialog

8 Program Options

This section is a small description from the Program Options Dialog (Figure 21). There is a lot of stuff you can configure, this makes the Options Dialog appearing huge and confusing, but I tried to make it as intuitive as possible, and I had a look to make the initial settings usable, so you probably don’t need to adjust there very much at the beginning. Generally use the TreeView at the left side from the Dialog to select the section (page) you want to edit. Each node in the TreeView provides a Page with Options to configure, the Parentnodes as well. It is possible to export all Settings written to the registry to a Registry file (*.reg), to do so use the“Backup”- Button from this Dialog. You can import such files with RegEdit, or you can just doubleclick on such a file to import it into the Registry. The “Backup” Button starts RegEdit, which is capable to export Registry Keys to a file, with the com- 8 PROGRAM OPTIONS 61 mandline regedit /e “<filename>” “HKEY CURRENT USER\Software\Ascher\syn”, before you’re prompted to choose a filename for the REG file. This can be useful when you want to uninstall syn (the Uninstaller deletes all Registry Keys), but keep the set- tings for a possible later installation, or when you plan to reinstall Windows, or upgrade to another Windows Version.

8.1 General

MRU Filelist: Enter here the count of files in the recent file list. Show full Path: If activated the list shows the files with path, if not it shows only the filetitle. Date/Time Format: Enter here the format from the date and time to insert with the “Insert Date/Time” (5.12.1) command. Right beside the TextBox is a preview, how it would look like. The format is modified according your system settings (e.g. language etc.). Characters:

• y . . . Year • m . . . Month • d . . . Day • h . . . Hour • n . . . Minute • s . . . Second

Monitor for external changes: If you want to monitor opened files for changes made by an external program activate this, for more information see 5.7. Limit to one instance: If checked its not possible to start a second instance from this program, more information about this can be found in section 5.8. Minimize when last Document is closed: Activate this if you want that the pro- gram minimizes itself when the last Document has been closed, i.e. there is cur- rently no Document opened. Make Backupcopy every xxx Seconds: Check this if you wish to make a backup copy from an opened Document in specific intervals. The Backupfile will be deleted when the Document closes normal, this is just in case the Program or Windows crashes. This uses a Timer and may slowdown the program. 8 PROGRAM OPTIONS 62

Note: As Interval units are Seconds used, i.e. when you choose 1 as interval it will make every second a copy, which may cause heavy harddisk usage.

The backup file has the same name (and is in the same folder) as the original file, but it appends the extension “bak”, e.g. when the original file has the name “mydoc.txt”, the backup file will have the name “mydoc.txt.bak”.

Save Bookmarks and Caret Position: When this option is activated the program creates for each file you’ve opened a file (with the same name as the opened file but with the extension “sbm”), and stores there the Bookmarks, the Caret Position and the Topline when this Document is closed. If you open this file again, and there is such a file, it will restore the Bookmarks, places the Caret, an scrolls to the Topline where it was on closing it before. If you don’t activate this, this additional file is not created. See also Section 5.18.

Make Bookmark files (*.sbm) hidden: Set the Hidden Attribute for the Bookmarks files.

8.2 View

Show “New” Dialog (Figure 30) when using the New command: If checked a Dialog to choose the Highlighter and filename will appear when you use the New command.

Show “Welcome” Dialog (Figure 32) on startup: If checked a Dialog will appear on each startup from the program.

Show Workspace when loading Project by default: If checked and you create a new Project the Checkbox “Show Workspace when loading this Project” in the Project Options Dialog is initially checked.

Hide Workspace Window: When checked the Workspace (7.9) is hidden at startup regardless the visible state on closing the program. The Workspace Window ap- pears automatically when you open a Project and “Show Workspace when loading this Project” is activated in the Project Options (11.1).

Hide Output Window: When checked Output window (7.10) is hidden at startup re- gardless the visible state on closing the program. This is useful for maximizing the Editor space, the Output Window appears automatically when Messages arrives. 8 PROGRAM OPTIONS 63

Outputlist: Some options to change the appearance from the Error- and Outputlist, Font changes the Front from the lists, and Itemheight changes the height from the Items in the list. Use “Default” to autosize the Height to the Fontheight. If you’re not using “Default” it may flicker a little when your computer is low of resources. This applies only to the Outputlist, not to the Find in Files lists. Window Bar: Options to change the appearance from the Window Bar (Figure 20). Use “Ownerdraw” if you want to see the Icons from the Document in the Window Bar, then you’ll be able to change the maximal width from a Tab. Use 0 if you don’t want to limit the width from the button, it will show then the whole title from the document regardless how long it is, otherwise it will short the title using ellipsis (e.g. “mylongdocum. . . ”), like the Windows Taskbar does.

8.3 Print

Highlight: If checked the program will print the Document with the Syntaxhighlight. Use colors: If checked the program uses colors for the Syntaxhighlight. Linenumbers: If checked the program will print the Linenumbers. Linenumbers in Margins: If checked the program will print the linenumbers in the left Margin. Pageoffset: Lineoffset: Wrap long lines: If checked long Lines which would exceed the Page will be breaked at the end of the Page. Orientation: Print Portrait or Landscape. This doesn’t change your System Settings.

8.4 Associations

You can associate syn with filetypes, so it will appear in the Contextmenu from the Windows Explorer, when you rightclick on such a file. It’s not possible to make the entry from syn the default command, and I think it wouldn’t be useful. If you want to open files with syn as default you can use regedit or the Windows Explorer Options. It will add an association for each filetype in the Filterstring from a checked item. 8 PROGRAM OPTIONS 64

Files to associate: This list lists all filetypes which have an associated Highlighter. Check here the filetypes to associate with syn.

Menutext: Enter here the Text from the Menuitem in the Windows Explorer.

Add: Click this Button to add the association.

Remove: Click this Button to remove the association.

Note 1: It could be possible that syn is not able to remove all the Keys from the Registry when you remove an association.

Note 2: You’ll need write access to the HKEY LOCAL MACHINE Registry key. Or- dinary users are not allowed to write to this key on Windows 2000, you’ll need Administrator or Power User Privileges, when you’re using Windows 2000, Win- dows NT 4.0 is no problem.

8.5 Run

Save before Run/Check: If checked the program will save all opened files before it starts the program for running or checking.

Outputlist: Options to control the Outputlist. This applies only to the Outputlist, not to the Find in Files lists.

Clear before running: Clears the contents from the outputlist. Print Commandline and. . . : Writes some informations, like the Commandline and Workingdirectories to the list. Scoll List automatically down: scrolls the list automatically to the bottom of the list.

Priority class: Choose here the priority from the called program. Handle this feature with care, all above Normal Priority (High, Realtime) will slowdown all other pro- cesses extremely! You won’t even get the possibility to terminate such a process, because syn has no chance to respond to a userinput. Possible values are, read them carefully: 8 PROGRAM OPTIONS 65

Idle: Indicates a process whose threads run only when the system is and are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle priority class is inherited by child processes. Normal: Indicates a normal process with no special scheduling needs. High: Indicates a process that performs time-critical tasks that must be executed immediately for it to run correctly. The threads of a high-priority class pro- cess preempt the threads of normal-priority or idle-priority class processes. An example is Windows Task List, which must respond quickly when called by the user, regardless of the load on the . Use extreme care when using the high-priority class, because a high-priority class CPU-bound application can use nearly all available cycles. Realtime: Indicates a process that has the highest possible priority. The threads of a real-time priority class process preempt the threads of all other processes, including operating system processes performing important tasks. For exam- ple, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive. Timeout for the Console: Choose here the Time the program should wait until it shows an Messagebox which asks you whether you want to terminate the process, or to wait some more time. It’s not possible to pass userinputs to the program, when it waits for some. Linehighlight: Choose here the color the line should be highlighted when you dou- bleclick in the Output list. Log to file: If checked it will save the entire Outputlist to a file, when the process is finished. The filename is either the projectfilename, when a project is loaded, or the filename from the active document with the Date and Time, to get an unique name, and the extension LOG. Example: myfile 14.01.02 11-56-57.log. The format may differ from this example depending on the language you’re using.

8.6 Scripts

Default Scriptengine: Specifies the default Scriptengine, see how the Scriptengine is chosen in the Script Referecne. Allow UI: Allow the use of a Userinterface. 8 PROGRAM OPTIONS 66

Use save Subset: Allow only the use of save controls.

Load Scripts at Startup: Specify here whether the program should create a Toolbar- button and Menuitem for a Script and for which one.

Events: syn can execute a Script on certain Events, like Program Start, Open Docu- ment etc. Add here a list of Script Files you wish to execute on such events.

8.7 Tools

Setup here the Usertools, more information can be found 5.5.

8.8 FTP

Configure here the FTP Feature (5.16):

Password for Anonymous Login: 10 Enter here the Password you want to use when you login as anonymous to a FTP Server, it is usually your Email address (or any Email address).

Save Password to the Registry: If checked the passwords to login into a FTP server will be saved to the Registry. This is the default value for “Save Password” in the Open/Save dialogs, and has no other effects.

Server: Here you can add, remove and edit your favorite server, which you’ll find in the Open and Save Dialog. It won’t make much sense when you’re using Binary as Transfertype, because I guess you’ll edit primarily ASCII files, which should be uploaded in ASCII Transfermode, but, of course, it’s up to you.

Warning: The Passwords are saved to the registry using a simple cryption al- gorithm. If you don’t want to save the Passwords to the Registry leave the Password field blank and uncheck the Checkbox “Save Password” in the Open and Save Dialog.

10This is just that it’s complete, you won’t be able to upload files to a FTP Server when you’re logged on as Anonymous in most cases. 8 PROGRAM OPTIONS 67

8.9 Editor General

Some general options for the Editor. Most of this settings are read when a document is created, hence changes won’t take place immediately.

Font: Changes the Font from the Editor. Fontcolor and -style are only used when no Highlighter is assigned.

Max Undo: Enter here the count of maximum undoable actions.

Max left Char: The end of the Editor, lines are not exceeding this Limit. If you are loading a file into an editor which has a line longer than this limit it will truncate this line.

Right Edge at: Enter the count of characters where the gray line in the Editor should appear. Use zero to hide this line.

Extra Linespacing: Extra spacing between the lines.

Block Indent Size: Enter here the count of Characters for indenting a selected Block.

Default Linebreak: Choose here your preferred Linebreak style.

Tabs: Enter here how Tabs should be handled, if Want Tabs is not checked, you won’t be able to enter Tabs.

TabStops: Enter here your custom Tabstops. Separate the Values with a comma, e.g. ”3,8,10”. Each comma must follow a numeric Value, Spaces and other characters are not allowed and will raise an Exception. Changes requires a programrestart to take place.

Colors: Changes some colors in the Editor. The default colors are taken from the Systemcolors.

Background: The backgroundcolor from the editorwindow. Selected Background: The backgroundcolor from the selection. Selected foreground: The Fontcolor from the selection. Current Line: The backgroundcolor from the line where the Caret is. If you don’t want to highlight this line use the system color “Window”, or click the “Don’t highlight” entry. 8 PROGRAM OPTIONS 68

8.10 Syntaxhighlight

Choose Highlighter: Choose here how the program should choose the Highlighter.

From Fileextension: the Highlighter is chosen according the associated Fileex- tension. Use none: No Highlighter is used, when you load a Document, you can choose one manually with the View Menu. Use always: The Highlighter chosen in the ComboBox bellow is always used, regardless what file it is.

8.11 Highlighter

This page is for configuring language dependent options. Everything which is individual for a language can be found here.

8.11.1 Highlight

Choose here the style how the files should be highlighted, the Fontcolors and -styles from the Tokens, and the comment style for this language (used for Un-/Comment Block, 5.12). Changes here will take affect immediately, you even don’t need to click the OK Button, because it writes this settings directly to the Registry.

8.11.2 Autocomplete

Customize here the Autocomplete feature, for more information see 5.11.

Autocomplete file: The filename from the Autocomplete file. Use the Browse Button (. . . ) to browse for a file.

Delimiter Chars: Enter here the Characters which should be taken as delimiters be- tween the Tokens.

The ListView: Shows all defined Code Templates. To edit one, select it in the List and Click “Edit. . . ” or “Delete”, to delete one item. Write the Body from the Template into the Memo at the bottom. 8 PROGRAM OPTIONS 69

Figure 22: Options Autocomplete 8 PROGRAM OPTIONS 70

Add. . . : Adds a Code Template, it will prompt you to enter a Name and a Description.

Edit. . . : Edits the Name or Description from the selected Code Template.

Delete: Deletes the selected Code Template. Before you’re prompted whether you’re sure, because you can’t undo this action.

The Memo: Enter in the Memo the Body from the Code Template. This text will appear in the Editor, when you insert a Template.

8.11.3 Profiles

Configure here the Profiles you want to use when you use the “Run File” commands.

8.11.4 Help

Choose here the helpfile you want to associate with this syntax scheme, see 5.15 for more information. You can also define a Map, which Helptopic should be shown for a specific Token, rather than searching the Token in the Index. Enter as Topic ID the numeric Identifier from the Topic to show. This works for *.hlp and *.chm files only.

8.11.5 Ctags

Here you can enter what additional parameters should be passed to the Ctags program. For a list of possible options and parameters see the Ctags Documentation. You may also disable the automatic call of ctags for this particular language.

Enabled: If checked Ctags will be called to parse these documents.

Show extended fields: If checked it shows the extended fields Ctags emits in the List.

Don’t show these Type: Enter here a list of characters which should not be shown in the list. The first character in the List is the Type of this Tag. So if you don’t want to see Tag of Type c and f then enter there cf.

Options for Ctags: Commandline options to pass to Ctags when calling it. 8 PROGRAM OPTIONS 71

8.12 Autocorrect

Enabled: Activate this to use this feature.

Correct on Mousedown: If activated it will correct the Word when you press the Mouse Button.

Beep on correct: If it corrects something it will beep.

Ignore Case: If activated it will ignore the case from the word to replace, e.g. it will replace (c) as well as (C).

Maintain Case: If activated it will use the same case.

8.13 Spell Checker

Dictionary: The Dictionary file. You can download dictionaries for different languages from Jacob Dybalas Homepage at http://www.synspellcheck.prv.pl/.

Auto Check: If checked it underlines bad Words in the Editor.

Start from Cursor: If checked it begins from the Cursor rather than from the begin.

Ignore single Characters: Ignore Words with only one Character.

Ignore Words with Numbers: Ignore Words which contains numbers.

Hash Length: A higher value will short the list of suggested words.

Pen Color: Choose the color to use to underline bad Words.

Check What: Enter here the Attributes which should be checked.

Edit Dic., Edit user Dic.: Opens either the Dictionary or the user Dictionary in Notepad, so you can edit it. 8 PROGRAM OPTIONS 72

8.14 Editoroptions

Some other options for the editor.

ALT sets Columnselection Mode: If activated then the Alt Key sets the editor in columnselection mode. i.e. you’ll be able to select columns from a Text. Autodetect URL’s: Enables automatically detection of URLs in the editor. If you hold the Ctrl Key down and click on a URL it will open it with the default program. Autoindent: Enables automatic indentation. Clear Undo after saving: If checked, the undo buffer is cleared after you save the document. Drag and Drop editing: If activated you will abe able to drag text and drop it to another position. Drop files: If activated, files dropped into the editor will be inserted at the position from the mouse, if not it will open it in a new editor window. Enhanced Homekey: If activated and you use the Home key one time, the caret is placed at the first occurrence of a non white-space, the second time it’s placed in column 1. Group Undo: Half Pagescroll: Scroll past EOF: Scroll past EOL: You’ll be able to place the caret beyond the text. Show Scrollhint: Shows a hint window with the linenumbers when you scroll the ed- itor. Tab Indent: If activated you can also use the Tab and Shift+Tab Key to un-/indent text. Tabs to Space: Replaces Tabs with Spaces while you’re typing. Trim trailing Spaces: Removes all spaces at the end of the lines. Highlight matching Brackets: Highlights Bracket pairs. 8 PROGRAM OPTIONS 73

8.15 Gutter

The Margin at the left hand side from the Editor.

Visible: If not checked the right Margin with the Linenumbers will not be visible.

Autosize: Autosize the width to the Linenumbers.

Color: Choose the backgroundcolor from the Gutter.

Show Linenumbers: Selfexplaining.

Digitcount: Choose here the count of digits from the Linenumbers.

Leading Zero: If checked it shows a leading Zero.

Zero start: The first line will have the number Zero.

8.16 Shortcuts

The list shows all Shortcuts you can use in the Editor, use the buttons at right hand side to Add, Edit, or Delete one or more of them. 9 PAGE SETUP 74

Figure 23: Page Setup Dialog Margins

9 Page Setup

Use this Dialog (Figure 23) to setup the Page for Printing and Print Previewing. If you have a Document opened, you can preview it via the “Print Preview. . . ” Button, but when you’ve changed the options you’ll have to apply them first using the “Apply” Button, to see the changes.

9.1 Margins

Enter at this Page (Figure 23) the Margins.

9.2 Header/Footer

Use this Page (Figure 24) to setup a custom Header and Footer for the Page. Use the Toolbar at the top to insert some variables like Date, Time, Pagenumber etc., and to 9 PAGE SETUP 75

Figure 24: Page Setup Dialog Header/Footer format the header or footer. The Buttons from the Toolbar applies to the - in this case - green Textfield. To activate an other Textfield give it the Inputfocus, e.g. click into it. 10 CUSTOMIZE 76

Figure 25: Customize Toolbars

10 Customize

Dialog to customize the Toolbars, Actions, Shortcuts as far as possible.

10.1 Toolbars

You can find in the list all Toolbars which may be visible for some reason. To make one visible check the corresponding Checkbox, to make one invisible uncheck etc. . . (you know what I mean). It’s not possible to make the Menubar invisible, thus appears this Item disabled. The Project Tools Toolbar isn’t visible when no project is opened, but you can show (or hide) it anyway, it just may not contain any Toolbarbutton. If you haven’t already configured any Tool the Tools Toolbar may also be invisible, and won’t have any buttons. 10 CUSTOMIZE 77

Figure 26: Customize Keyboard

10.2 Keyboard

This is the page to assign to each Action a Shortcut. Enter the Shortcut you would like to have and click “Assign”. If this Shortcut is currently assigned to an other Action the program will show a Messagebox, that you can’t use this shortcut. If you want to clear a Shortcut use the “Clear Key” Button, the Backspace Key will not work, because it assumes you want to use this Key as Shortcut. The Program doesn’t check whether there are Shortcut conflicts with the Shortcuts from the Editor, you can configure in the Options Dialog, Page Shortcuts (8.16). Any- way, this Shortcuts will be processed first, and if a Keystroke is assigned to one of this Actions the Editor will not receive this Shortcut. Please let me know when you have encountered a build in conflict from this Shortcuts.

10.3 Mouse

At this Page you can assign the Double-Click Event in the Editor with an Action you want. The selected Action is executed when you doubleclick in the Editor. 10 CUSTOMIZE 78

Figure 27: Customize Mouse

10.4 Options

Some other Options:

Show Tooltips on Toolbar: check this if you wish to see the Tooltips from the But- tons in the Toolbar.

Show Shortcutkey in Tooltips: check this if you wish to show the Shortcuts in the Tooltip.

Show Captions: check this if you wish to see the Captions from the Buttons on the toolbar. 10 CUSTOMIZE 79

Figure 28: Customize Options 11 PROJECTOPTIONS 80

11 Projectoptions

Use this Dialog to configure the Projectoptions, you can call it via the “Options” Menu- item in the “Project” Menu (6.5).

11.1 General

Some general stuff, e.g. the Projectname, the filename from the project, and which file from the project should be loaded when opening this project:

Load none: no file will be loaded.

Load all: all files will be loaded.

As in last session: all files which was loaded when this project was closed the last time will be loaded.

The projectname has no effect, except it will be shown in the Titlebar from syn, and in the Workspace. Use the “Parameters” TextBox to specify some default parameters to pass to a pro- gram which is called via the Run command. It appends this to the commandline like the Parameters specified in the Parameters Dialog (12.1), i.e. both are appended. Use the “Before closing this Project execute” ComboBox to choose a Tool which will be executed when you close this project. This may be useful when you compile a project, with a compiler which generates lots of intermediate files, and want to clean up the directory. You can use for this task a Batch file or a DOS command.

11.2 Files

At this page you can add, remove and swap the files from the project. The order in the list is the order in which the files are loaded, i.e. the last file will be the active one. Use the sort button if you wish to sort the list of files. 11 PROJECTOPTIONS 81

11.3 Profiles

The Run and Check (5.1) settings are overwritten with the settings at this page, you can use for each project separate programs to run or check the project. The programs from the syntaxsettings are not used as default values, when you’ve a project open and you haven’t configured this settings you can’t use the Run and Check commands.

11.4 Tools

You can have for each project additional Tools, which you can call via a separate Tools Toolbar. When not at least one Tool is configured this Toolbar is not visible. The Projecttools acts similar to the usual tools you can define with the “Configure Tools” Dialog (12.4). 12 OTHER WINDOWS 82

Figure 29: Parameters Dialog

12 Other Windows

Here are some other windows and dialogs described, which you may see sometimes in syn.

12.1 Parameters Dialog

Use the Parameters Dialog (Figure 29) (“Run” → “Parameters. . . ”) to add quickly more Arguments to the commandline without the need of changing the Project or Syntax settings. You can also use the usual Variables (5.2). This Arguments are appended to the commandline. You can also override the Workingdirectory using this Dialog, It accepts also the usual Variables. Use the Browse Button to choose a Directory, or the Variables Button to show a Menu with the Variables. The last 10 Arguments and Directories are saved, 12 OTHER WINDOWS 83 and you can choose it from the Dropdown List. This Parameters are only added when you use the Run File or Project commands, it does not work for Tools. To delete an Item in the Parameters or Directory List, select the desired Item in the List and hit Ctrl+Del. A more quick way to change the Parameters and/or Workingdirectory is to use the Textboxes in the Parameters Submenu. Added or changed Parameters and/or the Workingdirectory in this way is not saved in the history. You may also change the Environment Variables for syn, and thus also for the process which is created when you use the Run command. This changes are not persistent, they apply only for the current process, i.e. it will start everytime with the same Environment variables. To change these variables permanently use the Control Panel Applet“System” on NT, or Autoexec.bat on 9x/ME.

12.2 New Dialog

If you have activated “Show New Dialog when using the New command” in the Options Dialog, it will show the New Dialog (Figure 30) every time you use the New command, otherwise it will create a new Document. Use also this Dialog to create a new Document based on a Template (Figure 31).

12.3 Welcome Dialog

If the Option “Show Welcome Dialog on startup” is activated it will show the Welcome Dialog (Figure 32) every time the Program starts. You can also invoke this Dialog via a commandline switch, even when this Option is not activated, see the Commandline Switches section (14).

12.4 Configure Tools

Use this Dialog to define custom Tools, which you can call via a Menuitem or a Tool- barbutton. For more informations about Tools see Section 5.5. Use the Toolbar at the top to add, remove, move up or down or to edit a Tool.

Icon File: Enter here the filename from an Icon File (*.ico) or from any other file to show as icon in the Menu and Toolbar. 12 OTHER WINDOWS 84

Figure 30: New Dialog: Plain File

Figure 31: New Dialog: Templates 12 OTHER WINDOWS 85

Figure 32: Welcome Dialog 12 OTHER WINDOWS 86

Figure 33: Configure Tools Dialog

Toolkind: Choose here the kind of the Tool, this can be “Launch Program”, “Insert String”, “Execute Editcommand” or “DOS Command”.

12.4.1 Launch Program

Program: The Filename from the Program to start.

Arguments: Optional Arguments to pass to the Program.

Workingdirectory: The Workingdirectory from the Program to start.

Capture Console: If activated the Output from the Console Program is redirected to syn, and shown in the Output List. 12 OTHER WINDOWS 87

Hide: If checked the Program is hidden, makes no sense when the Program is a GUI program.

12.4.2 Insert String

Enter in the Textbox the String to insert. Use the “Variables” Button to show a Menu with some Variables.

12.4.3 Execute Editcommand

Choose the Command to execute from the Combobox.

12.4.4 DOS Command

Command: The Command to execute.

Workingdirectory: The Workingdirectory in which the Batch interpreter will be started.

Hidden: If checked, you won’t see a DOS Box.

12.5 Save Dialog

The Save Dialog (Figure 34) appears when you use the “Close all Files” Command, or you close a project or the program, and there are some files, which was not saved, i.e. has the Modified flag. You can save with this Dialog all modified files at once, save none of them or cancel the operation. You’ll find in the list from this Dialog all modified files, files with a filename are selected. To select or unselect a file just click on it. All selected files will be saved when you click the “OK” Button.

OK: Save the selected files.

Cancel: Cancel the operation, e.g. the project, program or file is not closed.

Save all: Saves all files in the list, regardless the selection in the list.

Save none: Saves none of the modified files, regardless which files are selected. 12 OTHER WINDOWS 88

Figure 34: Save Dialog

12.6 Confirm Replace Dialog

The Confirm Replace Dialog (Figure 35) gets invoked when you want to replace text using the Replace (5.13.5) Command, and you click then OK. It doesn’t appear when you use the “Replace all” Button in the Replace Dialog (Figure 10), because it doesn’t ask you anything in this case.

Yes: Replace this occurrence of the text. No: Don’t replace this occurrence of the text. Cancel: Cancels the operation. Yes to all: Will replace all occurrences from the text without asking you again.

12.7 Marker Dialog

Use this Dialog (Figuer 36) to Add a new or Edit an existing Marker. Markers are similar to Bookmarks, but they have more features, like you can give it a Name, assign a Priority etc. 12 OTHER WINDOWS 89

Figure 35: Confirm Replace Dialog

Caption: The Name or a Caption of the Marker.

Type: Choose the Type of the Marker. Possible Types are:

• Numbered Bookmmar is an ordinary Bookmark. Some call them Borland styled Bookmarks. • Bookmark (default) is the same as a numbered Bookmark, but you may have an unlimited count of them. Also known as Microsoft styled Bookmarks. • To Do • Bug • Note • Question

Proirity: Choose here if you think this should be done in the next time, or if someone else could do it as well one time ;-).

Line, Column: The Position of the Marker.

File: You can only choose the file when you add a new Marker, it’s not possible to change the file of an existing Marker.

Comment: A comment for the Marker, may be multiline.

12.8 File Properties Dialog

The File Properties Dialog is similar to the Windows Explorer one, it shows some infor- mations about the active file, e.g. Size, File Date/Time, MS-DOS Name etc. You may 12 OTHER WINDOWS 90

Figure 36: Marker Dialog (Add Marker) also change the Modified and Read-only flag with this Dialog. To show this Dialog use the “Properties” Menuitem in the “File” Menu (6.1).

12.9 File Versions

The File Version Dialog shows the Version Numbers from some important files syn uses sometimes. To show this Dialog use the “Version” Menuitem in the “Help” Menu (6.10). It is not necessary that all files are present, e.g. syn can do without the “synftp.dll” or the “hhctrl.ocx”. If some of this files are not available, you may not be able to use all of the features from syn.

12.10 Windows Dialog

Use the Windows Dialog (Figure 37) to activate, save, close etc. opened windows. To show this Dialog use the “Windows” Menuitem in the “Window” Menu (6.9). 12 OTHER WINDOWS 91

Figure 37: Windows Dialog

12.11 Print Preview Window

Use the Print Preview Window to view the active file as it would be printed to a printer. To show this Window use the “Print Preview” Menuitem in the “File” Menu (6.1).

12.12 Keyboard Map

This Window shows the current keyboard mapping, to see the default Keyboard Map- ping refer to section 13. To change this mapping use the Customize Dialog (10), which you can call with the Customize Menuitem in the View Menu (6.4). Show the Keyboard Map Dialog with the “Keyboard Map” Menuitem in the Help Menu (6.10). You can also use this Dialog to copy or print this list:

Print: Use the Print Button to print the entire list to a printer. Before the Printer Dialog will appear, where you can choose the printer.

Copy: Use the Copy Button to copy the selected Items in the list to the Clipboard.

Category: Use this ComboBox to choose the category for which to show the commands, choose the “All Commands” Item in this list to show all commands and “Bound 12 OTHER WINDOWS 92

Commands” to show all commands which have a Shortcut Key assigned. This Items are equal to the Menus, e.g. File commands can be found in the File Menu etc. 13 DEFAULT KEYBOARD MAP 93

13 Default Keyboard Map

You can see the actual list when you use the “Keyboard Map” Menuitem in the “Help” Menu (6.10). This list you can see here shows the preconfigured Shortcuts, and, sure, it doesn’t show the Tools, because there are no preconfigured Tools.

13.1 File

Command Shortcut Description Close Ctrl+F4 Close active Document Close All Files Shift+Ctrl+F4 Close All opened Documents Exit Alt+F4 Exit this Program Export to HTML. . . - Export file as HTML Export to LaTeX. . . - Export file as LaTeX Export to RTF. . . - Export file as RTF New Ctrl+N Create new Document Open from FTP. . . - Open file from FTP Server Open Next Shift+Ctrl+O Open Next File Open. . . Ctrl+O Open existing Document Page Setup. . . - Setup page Print Preview - Preview active Document Print. . . Ctrl+P Print active Document Properties - Show File Properties Reopen file - Reload file from Disk Save Ctrl+S Save active Document Save all - Save all opened files Save As. . . - Save active Document under a different filename Save to FTP. . . - Save file to FTP Server 13 DEFAULT KEYBOARD MAP 94

13.2 Edit

Command Shortcut Description Ansi to OEM - Convert from Ansi character set to OEM character set Append Copy Shift+Ctrl+C Append selection to the Clipboard Append Cut Shift+Ctrl+X Cut the Selection and append it to the Clipboard Capitalize - Capitalize selection Check Spelling. . . - Check for spelling errors Comment - Comment Block Copy Ctrl+C Copy selection to Clipboard Cut Ctrl+X Cuts selection Decrease Indent - Unindent Selection Delete - Delete selection Delete Lines Ctrl+Y Delete selected Lines Delete to BOL - Delete from Caret to the begin of the Line Delete to EOL Shift+Ctrl+Y Delete from Caret to the end of the Line Delete Word Ctrl+T Delete Word under the Caret DOS/Windows - Convert to DOS Linebreak Duplicate Lines - Duplicate selected Lines Encoding. . . - Change Codepage Format Lines. . . - Break lines at right Edge Increase Indent - Indent Selection Insert Date/Time - Insert the current Date and/or Time Insert File. . . - Insert File at Cursor Invert Case Ctrl+K Invert selection case Join Lines. . . - Join selected Lines Leading Space to Tabs - Replace leading Spaces with Tabs Leading Tabs to Space - Replace leading Tabs with Spaces Lower Case - Selection lower case Modified - Toggle Modified state OEM to Ansi - Convert from OEM character set to Ansi character set Paste Ctrl+V Paste Clipboardcontents Paste special. . . Shift+Ctrl+V Paste with some options Read only - Toggle Read only state Redo Shift+Ctrl+Z Redo last Action Save. . . - Save selected lines to file Select All Ctrl+A Mark all as selected Select Line - Select entire line Select to BOL - Select form Caret to the begin of the Line Select to EOL - Select form Caret to the end of the Line Select Word - Select Word under the Caret Sentensize - Sentensize selection Sort. . . - Sort selected lines Space to Tabs - Replace Space with Tabs Split Line - Split line at caret position Tabs to Space - Replace Tabs with Space Trim trailing Spaces - Remove all Spaces from the end of the lines Uncomment - Uncomment Block Undo Ctrl+Z Undo last action UNIX - Convert to UNIX Linebreak Upper Case - Selection upper case 13 DEFAULT KEYBOARD MAP 95

13.3 Search

Command Shortcut Description Add Marker. . . - Add new Marker Bookmark 0 Alt+0 Goto Bookmark 0 Bookmark 0 Ctrl+0 Set Bookmark 0 Bookmark 1 Alt+1 Goto Bookmark 1 Bookmark 1 Ctrl+1 Set Bookmark 1 Bookmark 2 Alt+2 Goto Bookmark 2 Bookmark 2 Ctrl+2 Set Bookmark 2 Bookmark 3 Alt+3 Goto Bookmark 3 Bookmark 3 Ctrl+3 Set Bookmark 3 Bookmark 4 Alt+4 Goto Bookmark 4 Bookmark 4 Ctrl+4 Set Bookmark 4 Bookmark 5 Alt+5 Goto Bookmark 5 Bookmark 5 Ctrl+5 Set Bookmark 5 Bookmark 6 Alt+6 Goto Bookmark 6 Bookmark 6 Ctrl+6 Set Bookmark 6 Bookmark 7 Alt+7 Goto Bookmark 7 Bookmark 7 Ctrl+7 Set Bookmark 7 Bookmark 8 Alt+8 Goto Bookmark 8 Bookmark 8 Ctrl+8 Set Bookmark 8 Bookmark 9 Alt+9 Goto Bookmark 9 Bookmark 9 Ctrl+9 Set Bookmark 9 Clear all Marker - Remove all Marker Clear Bookmarks Shift+Ctrl+F2 Clear all Bookmarks Delete Marker - Delete this Marker Edit Marker. . . - Edit this Marker Find in Files. . . - Searches for a string in multiple files Find Next F3 Find next match Find Next Word Ctrl+F3 Find next match from the Selection Find Previous Shift+F3 Find previous match Find Previous Word Shift+Ctrl+F3 Find previous match from the Selection Find. . . Ctrl+F Find text Goto last change Shift+Ctrl+G Move the Caret to the last edit location Goto next Output Item Ctrl+E Goto next Item in Output or Fin in Files List Goto previous Output Item Shift+Ctrl+E Goto previous Item in Output or Fin in Files List Goto. . . Ctrl+G Goto Line or Column Incremetal Search backward - Starts/Stops an incremental Search backwards Incremetal Search forward - Starts/Stops an incremental Search forwards Match Bracket Shift+Ctrl+B Goto matching Bracket Next Marker - Go to next Marker Previous Marker - Go to previous Marker Replace. . . Ctrl+H Repace text Show Caret Ctrl+F5 Scrolls the Window to bring the Caret into view Toggle Marker - Add or remove a Marker at the current line 13 DEFAULT KEYBOARD MAP 96

13.4 View

Command Shortcut Description Auto Spellcheck - Toggle Auto Spellcheck Mode Customize. . . - Customize Toolbars Edit - Show or hide Edit Toolbar File Explorer - Show or hide the File Explorer Full Screen F11 Toggle Full Screen mode Highlight Brackets - Toggle highlighting matching Brackets Main - Show or hide Maintoolbar Options. . . - Setup Programoptions Output Window - Show or hide Output window Project - Show or hide Project Toolbar Workspace - Show/hide the Workspace Window Refresh F5 Refresh File Explorer Run - Show or hide Run Toolbar Script - Show/hide Script Toolbar Show Linenumbers - Show or hide Linenumbers Show Whitespace - Toggle Whitespace Display Status Bar - Show or hide Status bar Tools - Show or hide Tools Toolbar View - Show/hide View Toolbar Window - Show or hide Window Toolbar Window Bar - Show/hide the Window bar Workspace - Show/hide the Workspace Window

13.5 Project

Command Shortcut Description Close - Close current Project New. . . Shift+Ctrl+N Create new Project Open. . . Ctrl+F11 Open existing Project Options. . . Shift+Ctrl+F11 Setup Projectoptions Sort Files - Sort Project Files

13.6 Run

Command Shortcut Description Configure. . . - Configure File Profiles Configure. . . - Configure Project Profiles Parameters. . . - Add Parameters to the Commandline Run File F9 Run active File Run Project F10 Run current Project Stop Process Ctrl+F2 Stop Run or Check Process

13.7 Script

Command Shortcut Description Execute. . . - Load and execute a Script file Run Active F8 Assume the active Document is a Script and run it 13 DEFAULT KEYBOARD MAP 97

13.8 Tools

Command Shortcut Description Configure. . . - Configure Tools

13.9 Window

Command Shortcut Description Arrange Icons - Arrange Icons Cascade - Cascate Windows Close - Close the active Window Close all - Close all Windows Minimize All - Minimize all Windows New Window - Create new Window from the active Document Next - Bring next Window to front Previous - Bring previous Window to front Tile Horizontally - Tile Windows horizontally Tile Vertically - Tile Windows vertically Windows. . . - Manage opened Windows

13.10 Help

Command Shortcut Description About syn. . . - Show Programinformation, Version number and Copyright Help Contents - Show the Helpfile Keyboard Map - Show Help to Keyboard Mapping Stefan’s Homepage - Open Stefan’s Homepage syn Homepage - Open the syn Homepage and look for News and Updates Versions. . . - Show Fileversions 14 COMMANDLINE SWITCHES 98

14 Commandline Switches syn [switches] [files] [switches] [files] [...]

-p: Prints the given file(s) to the default printer, and closes the program, just like Notepad. syn doesn’t care whether this switch is before or after the filename(s), i.e. “syn.exe readme.htm -p” is the same as “syn.exe -p readme.htm”.

-exhtm: Exports the given file(s) to a HTML File using the same filename but with the extension htm, and closes the program.

-exrtf: Same as above but the files will be exported to a RTF file. You can also combine the switches -p, -exhtm and -exrtf, e.g. “syn -p -exhtm myfile.ext” will print and export the file “myfile.ext”.

-extex: Exports the Document to a LaTeX file.

-w: Shows the Welcome Dialog (Figure 32) at startup even when you’ve deactivated it.

-n: Shows the New Dialog (Figure 30) at startup.

-op: Shows the Open Dialog.

-r: Opens in the files behind this switch read-only. Note: This switch must be before the filenames, e.g. “syn.exe readme.htm -r” will not open the readme file read-only, but “syn.exe -r readme.htm” will open it read-only. Only files with this switch before are opened read-only. Example: syn.exe -r file1.txt file2.txt -r file3.txt. In this example the file file1.txt and file3.txt are opened read-only, the file file2.txt is not read- only.

-nd: Creates a new empty document. If there is a -r switch before it will be read-only.

-line, -col: When given, it places the Caret at this position this line in the Editor. This switches must appear before the filename from the document. Example: syn.exe file1.txt -line 10 -col 2 file2.txt. This will cause that the line 10 in file2.txt will be highlighted, but not in file1.txt. It is not necessary that both switches appear, -line or -col alone will also work.

-highl: If set the line will be highlighted, must be used with -line, -col. 14 COMMANDLINE SWITCHES 99

-script: Executes a Script file. Example: syn.exe -script "D:\My Documents\MyScript.vbs".

-nodialogs: It doesn’t show any Dialogs at startup, SynTray uses this Switch.

Priority is the order like above, when you pass all switches only the print switch is processed, if you pass the -w and the -n switch only the -w switch is processed. You can combine the switches -p, -exhtm and -exrtf. When you pass a filename and one of the switches -w or -n, syn loads this file and shows the requested Dialog. This switches are not case sensitive. 15 MESSAGES 100

15 Messages

The Mainform from syn accepts some Messages, besides the usual Windowsmes- sages. You can read the Handle from the Mainform from the Registry (HKCU\Software\Ascher\syn\Main\hwnd). This Value holds the Handle from the Mainform from the last started instance, if syn is currently not running, this value doesn’t exist.You can find the Handle from other instances using the FindWindow API function, use as Classname“TSynMainForm”. Use the SendMessage et al. API functions to send a Message to the Window.

// Actions ------SYM_NEWDOCUMENT = WM_USER + 100 SYM_OPENDOCUMENT = WM_USER + 101 SYM_PASTECLIPBRD = WM_USER + 102

SYM_OPENFTP = WM_USER + 111 SYM_OPENFILE = WM_USER + 113 SYM_OPENPROJECT = WM_USER + 114

SYM_SAVEDOCUMENT = WM_USER + 121 SYM_SAVEALL = WM_USER + 122

SYM_CLOSE = WM_USER + 1000 SYM_RESTORE = WM_USER + 1001

// Informations ------SYM_ISENABLED = WM_USER + 500 SYM_GETDOCCOUNT = WM_USER + 510 SYM_GETACTIVEDOCMOD = WM_USER + 520

WM USER: The base value for userdefined Messages, it has the value $400 which is equivalent to 1024 in decimal.

SYM NEWDOCUMENT: Creates a new Document or shows the New Dialog (Fig- ure 30), wParam and lParam are not used.

SYM OPENDOCUMENT: Shows the Open Dialog to open a Document, wParam and lParam are not used. 15 MESSAGES 101

SYM PASTECLIPBRD: Creates a new Document and pastes the clipboardcontents into this Document, wParam and lParam are not used.

SYM OPENFTP: Shows the Open from FTP Dialog to download a file via FTP, wParam and lParam are not used.

SYM OPENFILE: Opens a file from the recent files list, wParam holds the 1-based index, lParam is not used.

SYM OPENPROJECT: Opens a project from the recent projects list, wParam holds the 1-based index, lParam is not used.

SYM SAVEDOCUMENT: Saves the active Document, if wParam is nonzero it will show the Save As Dialog, lParam is not used.

SYM SAVEALL: Saves all loaded Documents, wParam and lParam are not used.

SYM CLOSE: Closes syn, wParam and lParam are not used.

SYM RESTORE: Restores syn, wParam and lParam are not used.

SYM ISENABLED: Checks whether the Window is able to process Messages, the returnvalue will be nonzero when it is enabled, otherwise it returns zero.

SYM GETDOCCOUNT: Returns the count of currently opened Documents, you can use it to check whether there are Documents loaded, wParam and lParam are not used.

SYM GETACTIVEDOCMOD: Returns whether the active document has the Mod- ified flag set, i.e. the Document has been modified and not saved yet, wParam and lParam are not used.

It does not process Messages when there is a modal Dialog shown, i.e. the Mainwin- dow is disabled. You can check whether the Mainwindow is enabled or not with using the Message “SYM ISENABLED”. The only Messages which are processed when the Main- form is disabled, is are the Messages which returns informations, like“SYM ISENABLED” and “SYM GETDOCCOUNT”. This informations are only useful when you’re a and you want to access some functions from your own program. This is also the way SynTray (18) communicates with syn. 16 REGULAR EXPRESSIONS 102

16 Regular Expressions

This description is taken from the documentation to the TRegExpr Unit from Andrej V. Sorokin11, Copyright c 1999. Regular expression looks ugly for novices, but really it’s very simple (well, usually simple ;) ), handy and powerfull tool.

16.1 Some examples

• real number (examples ‘13.88e-4’, ‘-7E2’): ([+\-]?\d+(\.\d+)?([eE][+\-]?\d+)?)

• phone number (examples ‘+7(812) 555-5555’, ‘(20)555-55-55’, ‘555-5555’): ((\+\d *)?(\(\d2,4\) *)?\d3(-\d*)*)

• e-mail address (examples ‘[email protected]’, ‘[email protected]’): ([ a-zA-Z\d\-\.]+@[ a-zA-Z\d\-]+(\.[ a-zA-Z\d\-]+)+)

• Internet URL (examples ‘http://www.paycash.ru’, ‘ftp://195.5.138.172\default.htm’): ([Ff][Tt][Pp]|[Hh][Tt][Tt][Pp])://([ a-zA-Z\d\-]+(\.[ a-zA-Z\d\-]+)) ((/[ a-zA-Z\d\-\\\.]+)+)*

16.2 Detailed explanation

Any single character matches itself, unless it is a metacharacter with a special meaning described below. A series of characters matches that series of characters in the target string, so the pattern “bluh” would match “bluh” in the target string. Quite simple eh ? You can cause characters that normally function as metacharacters to be interpreted literally by prefixing them with a “\”. For example, “^” match beginning of string, but “\^” match character “^”, “\\” match “\” and so on.

11The used Library is from Andrej V. Sorokin, and you can download it at: http://anso.da.ru/. He translated some C code to Delphi and improved it to create the TRegExpr Unit. 16 REGULAR EXPRESSIONS 103

You can specify a character class, by enclosing a list of characters in [], which will match any one character from the list. If the first character after the ”[” is “^”, the class matches any character not in the list. Within a list, the “-” character is used to specify a range, so that a-z represents all characters between “a” and “z”, inclusive. If you want ”-” itself to be a member of a class, put it at the start or end of the list, or escape it with a backslash. The following all specify the same class of three characters: [-az], [az-], and [a\-z]. All are different from [a-z], which specifies a class containing twenty-six characters. If you want ‘]’ you may place it at the start of list or escape it with a backslash. Examples of queer ;) ranges: [\n- \x0D] match any of #10,#11,#12,#13. [\-t] match any digit, ‘-’ or ‘t’. []-a] match any char from ’]’..’a’. Characters may be specified using a metacharacter syntax much like that used in C: “\n” matches a newline, “\t” a tab, “\r” a carriage return, “\f” a form feed, etc. More generally, \xnn, where nn is a string of hexadecimal digits, matches the character whose ASCII value is nn. Finally, the “.” metacharacter matches any character except “\n” (unless you use /s modifier - see below. Note: in TRegExpr /s is set by default). You can specify a series of alternatives for a pattern using “|” to separate them, so that fee|fie|foe will match any of “fee”, “fie”, or “foe” in the target string (as would f(e|i|o)e). The first alternative includes everything from the last pattern delimiter (”(”, “[”, or the beginning of the pattern) up to the first “|”, and the last alternative contains everything from the last “|” to the next pattern delimiter. For this reason, it’s common practice to include alternatives in parentheses, to minimize confusion about where they start and end. Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching foo|foot against “barefoot”, only the“foo”part will match, as that is the first alternative tried, and it successfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.) Also remember that “|” is interpreted as a literal within square brackets, so if you write [fee|fie|foe] you’re really only matching [feio|]. The bracketing construct ( . . . ) may also be used for define r.e. subexpressions (after parsing you may find subexpression positions, lengths and actual values in MatchPos, MatchLen and Match properties of TRegExpr, and substitute it in template strings by 16 REGULAR EXPRESSIONS 104

Character Meaning ^ start of line $ end of line . any character \ quote next character * match zero or more + match one or more {n} Match exactly n times {n,\} Match at least n times {n,m} Match at least n but not more than m times [aeiou0-9] match a, e, i, o, u, and 0 through 9 ; [^aeiou0-9] match anything but a, e, i, o, u, and 0 thru 9 \w matches an alphanumeric character (including “_”) \W a nonalphanumeric \d matches a numeric character \D a non-numeric \s matches any space (same as [ \t\n\r\f]) \S a non space

Table 3: Metacharacters for Regular Expressions

TRegExpr.Substitute). Subexpressions are numbered based on the left to right order of their opening parenthesis. First subexpression has number ‘1’ (whole r.e. match has number ‘0’ - you may substitute it in TRegExpr.Substitute as ‘$0’ or ‘$&’). Any item of a regular expression may be followed with digits in curly brackets (now it implemented in TRegExpr only for simple cases. If you want to use curly brackets for subexpressions, please. remove ‘.’ from {.$DEFINE ComplexBraces} in regexpr.pas, but note - it’s not properly tested) of the form {n,m}, where n gives the minimum number of times to match the item and m gives the maximum. The form {n} is equivalent to {n,n} and matches exactly n times. The form {n,} matches n or more times. (If a curly bracket occurs in any other context, it is treated as a regular character.) The * modifier is equivalent to {0,}, the + modifier to {1,} and the ? modifier to {0,1}. There is no limit to the size of n or m, but large numbers will chew up more memory and slow down r.e. execution. 17 ESCAPE SEQUENCES 105

Escape Sequence Represents ASCII Value \\ Backslash 92 \a Alert (Bell) 7 \b Backspace 8 \f Formfeed 10 \n New line 13+10 \r Carriage return 13 \t Horizontal tab 9 \v Vertical tab 11 \s Space 32 \ddd ASCII character in decimal notation ddd

Table 4: Escape Sequences

17 Escape Sequences

Character combinations consisting of a backslash (\) followed by a letter or by a com- bination of digits are called “escape sequences.” To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences. An escape sequence is regarded as a single character and is therefore valid as a character constant. Escape sequences are typically used to specify actions such as carriage returns and tab movements on terminals and printers. They are also used to provide literal repre- sentations of nonprinting characters and characters that usually have special meanings, such as the double quotation mark (”). Table 4 lists escape sequences and what they represent. The sequence \s is a Space, and is mostly internally used, there should be no reason to use it elsewhere, instead of a normal Space. If you use the ASCII code, e.g. \065 for an “A”, the number must be three digits long, and it must be in the range of 0 to 255. \65 will not be recognized as an “A”. 18 SYNTRAY 106

18 SynTray

The program SynTray provides a Tray interface to syn, it is very small due to using only pure API and no VCL, it starts very fast and needs nearly no resources, it has just a very simple Messageloop. This Program has no Window12, but just a Popup Menu (18.1). It should give you a fast way to access some basic functions from syn. It is not possible to start more than one instance from SynTray, even not when you’ve two or more programs of this in different folders. This program uses always an existing instance from syn, if there is no instance it will start syn. When there are more than only one instance, it will use the last started. I recommend that you activate “Limit to one instance” (5.8) (Options → General, 8.1) which doesn’t allow to start more instances. A Yellow Icon in the System Tray indicated that syn is currently running, and a Red Icons means syn is not running.

18.1 Menu

A doubleclick with the Left Mousebutton makes the same as the “Show syn” Menuitem, a right click will show the Menu (Figure 38).

Show syn: Shows or launches syn.

New Document: Shows or launches syn and creates a new Document.

Paste from Clipboard: Shows or launches syn and creates a new Document with the Clipboardcontents.

Open Document: Shows or launches syn and shows the Open Dialog.

Open from FTP: Shows or launches syn and shows the Open from FTP Dialog (Fig- ure 12).

Recent Files: Lists all recently used files.

Recent Projects: Lists all recently used Projects.

12OK, it has a Window, but it’s not visible. It’s not possible to show a Menu which is not assigned to a Window, and it’s necessary to determine whether SynTray is already running. 18 SYNTRAY 107

Figure 38: SynTray Menu

Save Document: Saves the active Document.

Save all Documents: Saves all open Documents.

Save all and Close: Saves all open Documents and exists syn.

Close syn: Closes syn.

About SynTray: Shows version info from the SynTray program.

Exit SynTray: Exits the SynTray program.

18.2 Commandline Switches syntray [-close]

-close: Closes an active instance from SynTray and closes itself. If no instance from SynTray is running nothing happens. This switch is used to close SynTray when you’re uninstalling syn. 19 ASGREP 108

19 asgrep

19.1 License asgrep is Copyright c 2000-2003 by Ascher Stefan and Danail Traichev. This Program is Freeware. You are allowed to use and distribute asgrep for free, but you are not allowed to sell asgrep for profit. You are using asgrep at your own risk, no responsibility is taken for damages to your computer system. The Source Code is provided under the Mozilla Public License, see Appendix E.

19.2 Introduction asgrep is a Find in Files Utility, it supports Regular Expressions (16), multi Filemask with Wildcards and searches recursively all subfolders if requested. Additionally you may replace matches with another Text with support for Escape Sequences. Unfortunately it’s not that fast as Borlands Turbo Grep is. Sure, there are sitting lots of professionals, and I’m just a novice ;-). This is a Console Program, i.e. it has no graphical userinterface, so you can easily integrate it in your own program, e.g. as syn does.

19.3 Commandline Switches asgrep [-di ] [-fi ] [-ft ] [-rt ] [-cf ] [switches]

-ft: use this switch for the text to find.

-rt: and -rt for text to replace it with (binary files will be skipped).

-dt: or -dt to delete found text (binary files will be skipped).

-fi: before each filename use the switch -fi.

-di: if you want to search whole directories use -di. If you have set the r+ switch it will also search all subdirectoreis. 19 ASGREP 109

-ff: for the filefilter use -ff, you can only use one filefilter, you can also combine more filetilters with wildcards, e.g. *.pas;*.dpr.

-cf: you can also use instead of this parameters a configurationfile, use -cf configfile.txt.

-mc: report match count only. r+: for recursive search in directories use r+. c+: for casesensitive searche use c+. ww+: searching for whole words only. re+: use Regular Expression. bk-: Don’t backup file before replacing Text es+: use Escape Sequences for Replace text. b+: for correct search in binary files. b-: to skip binary files from search. w+: forces the program to build in some (50 ms) idle time (slower of course). d+: use d+, if you wish to display the line.

19.4 Using a configurationfile

If you have a lot of files and/or directories to search, in general when the commandline becomes rather long, you should use a configuration file. This file is similar to an ini-file:

[main] ; The Text to look for findtext=yourfindtext ; use 1 for match case, otherwise 0. matchcase=1 ; Replace the found match with this text replacetext=yourreplacetext ; Do replace the found text with replacetext doreplace=0 19 ASGREP 110

; Backup files before replacing backup=1 ; Replace Text contains Escape Sequences escapeseq=0 ; Search also binary files checkbinary=0 ; Skip binary files skipbinary=0 ; Format is either for example ‘‘*.htm;*.html" or ‘‘*.htm, *.html" filefilter=*.* ; force the program to wait the specified amount of milliseconds ; before it searches a file idle=50 ; for recurse search from the given dirs (search all subfolders) use recurse=1 ; searching for whole words only use wholewords=1 ; use Regular Expression, can’t be combined with wholewords regexp=1 ; Shows only the count of found Matches matchcount=1

[files] ; All files you want to search. count=2 ; count of the filelist 1=D:\1stFile.txt 2=D:\2ndFile.txt ; ...

[dirs] ; All directories you want to search. count=2 1=1stDir 2=2ndDir

All commandline arguments are overwritten by the configuration file, except files and directories, which are added to the list. If an option is not given in the configfile, 19 ASGREP 111 but in the commandline, it will use the option from the commandline. Should it be so, shouldn’t the commandline arguments overwrite the configuration file? Hm, not sure, give me a hint. If you replace Text binary files are automatically skipped, because it can’t correctly replace text in binary files. Before you replace text in files you should make a backup copy of these files.

19.5 Results

Matches are written in the consolwindow (StdOut), you can see the filename, the line- and columnnumber and the linetext. One emitted line can look like this, when you have display lines on, and report match count only off:

D:\Eigene Dateien\hp\download.htm: (72, 87): This Program uses the SynEdit

The first part is the filename, 72 is the linenumber, 87 is the columnnumber, and the last part is the linetext: FileName: (LineNumber, ColumnNumber): LineText.

19.6 Replace Text

It is possible to replace found matches with another Text. To do so provide the -rt switch followed by the new text. If your replace text contains Escape Sequences (17), and you wish to substitute them by the corresponding character provide also the es+ switch. If you additionally use the bk- switch it does not backup files before replacing text in them.

19.7 Credits

• The Regular Expression code is taken from Andrey V. Sorokin’s TRegExpr Unit (http://anso.da.ru/). 20 SYNCLP 112

20 synclp

20.1 License synclp is Copyright c 2002 by Ascher Stefan. This Program is Freeware. You are allowed to use and distribute synclp for free, but you are not allowed to sell synclp for profit. You are using synclp at your own risk, no responsibility is taken for damages to your computer system.

20.2 Introduction

This is a small Commandline Tool to copy the Profiles from a Language to a Project file. I thought it could be useful to have an easy way to copy all Profiles, which you have configured for a language to a project. Example, you have configured the Profiles perl.exe and perldoc.bat for the Perl Language, now you make a Project, and you want to have this Profiles also for “Run Project”, not only for “Run File”. It just reads the “Profiles” settings from a Language, and writes it to a Project. This is not a big thing, it just saves some time, maybe. If the Project file does not exist it creates it, but the Filename must not be empty. Make sure the Project file is not loaded by syn. This program is highly BETA, I wouldn’t use it for valuable Project files!

20.3 Commandline Switches synclp [Options] -lg

-lg: switch to identify the Languagename

: the Name from the Language to copy to the Project, e.g. Ob- jectPascal

: the Filename from the Project

-b: Backup Projectfile 20 SYNCLP 113

-ni: No Interaction, you’re not prompted for a Language or Project

-s: Silent, no progress

-vs: Very silent, no progress, no errors, no prompts

-l: Lists all valid languages

-?, -help: Show the help

-v: Show Version

If the Languagename or the Filename contains spaces, you must enclose it in Quotes. Example: synclp -lg ObjectPascal myproject.syp 21 REQUIREMENTS 114

21 Requirements

A Computer with a Microsoft 32 Bit Windows environment (e.g. Win9x, NT, 2000), 3 MB free harddisk space, Intel compatible Processor at least a 486 Processor (recommended Pentium 133 MHz) with 16 MB RAM (recommended 32 MB), depends on how fast it should be. Common Controls 4.71 13. If you can’t see the Icons on the Toolbars and in the Menus, you’ll need to install this Update. If you want to call Compiled HTML Help files from syn you’ll also need HHCtrl.ocx library14, and of course an installed Internet Explorer. This library is dynamically loaded, hence it does not require IE to run, but you won’t be able to view HTML Help files. MS Script Control and the Windows Scripting Host, if you want use Scripting, you can download it from http://msdn.microsoft.com/scripting/. I’ve tried to run the program on a naked Windows NT 4.0 without any Servicepack and Internet Explorer, it worked just fine, except the Icons on the Toolbar and in the Menus (the ImageList).

13You can download it at: http://support.microsoft.com/support/kb/articles/q186/1/76.asp, it’s about 500 KB. 14You can download it from http://msdn.microsoft.com/workshop/author/htmlhelp/default.asp. 22 KNOWN PROBLEMS 115

22 Known Problems

This is a small list from known Problems, Limitations and Bugs. If you have noticed problems please send a description to [email protected], thanks.

• The size of Files is limited to 2 GB.

• No automatic Linebreak, not really a Problem, at least not for me.

• and probably some more. 23 FEATURES 116

23 Features

• Advanced Editor (the main feature): – Syntaxhighlight for around 40 languages, and one custom Highlighter, fully customizeable. – Autocomplete like in Delphi with Popup List (5.11). – Autocorrect individual for all languages. – Bookmarks and other customizeable Marker. – Fully Customizable Shortcuts. – Many advanced Edit commands. – Columnselection Mode. – Powerful Search and Replace with Regular Expressions + Incremental Search (5.13.3). – Unlimited Undo and Redo. – Highlight matching Brackets. – Highlight current line. – Different Marker. • Start Commandline Programs (Compiler, Interpreter or whatever) and capture the Output + Regular Expressions to parse the output with so called “Profiles” (5.1). Profiles can contain more Programs, which are executed one after the other. For example, one Profile may contain a Compiler, Assembler and Linker. • Communicate with console programs, i.e. write something to StdIn, while a console program is running. • You can use it as Console Window with all the Edit features syn offers, see Section 5.3. • Scripting using your favorite Script Language (VBScript, JScript, PerlScript, or any other supported language) with custom Forms (modal Dialogs only) + execute Scripts on certain events. • Direct support for Ctags15 to obtain a list of functions in the active Document.

15Ctags is a program which parses Textfiles and emits useful informations of this Textfile. Ctags is and can be downloaded from http://ctags.sourceforge.net/. 23 FEATURES 117

• Configureable Tools (Start a Program, Insert a String into the Editor or execute an Editcommand).

• Spell Checker + check spelling while you’re typing.

• Export to HTML, RTF and LATEX. • Autodetect Linebreakstyles (DOS, UNIX or Mac), and convert them.

• Convert between different codepages (KOI8-R, ISO 8859, DOS, Mac).

• Print and Printpreview with Syntaxhighlight in color.

• Organize your files in Projects (5.6). Such Projects can have their own Profiles and Tools.

• Drag and Drop support (open or insert files).

• Ability to read and write Delphi binary form files (5.4).

• Assign to any Syntax Scheme a custom Helpfile and call it via a Hotkey (5.15).

• Edit documents “directly” on a FTP server + Proxy support (5.16).

• File Explorer (5.17).

• Saves Bookmarks and Caret Pos for each file, if you wish (8.14).

• Optional Tray Icon interface (18).

• Find and Replace in Files (5.13.4) + Regular Expressions (16).

• Document Templates.

23.1 Available Highlighters

1. 86HC11 Assembler 4. Baan

2. ADSP21xx 5. Borland Form definitions

3. AWK Scripts 6. C# 23 FEATURES 118

7. C++ 24. Modelica

8. Cache Object Script 25. Modula-3

9. CA-Clipper 26. MS-DOS Batch scripts

10. Cascading Style Sheets (CSS) 27. MS Visual Basic Script/VBScript

11. COBOL 28. My Inno Setup Extensions17

12. COBRA IDL 29. NSIS Scripts18

13. Fortran 30. Object Pascal

14. FoxPro 31. Perl

15. Galaxy 32. PHP

16. GW-TEL Script 33. Progress

17. HP48 Assembler 34. Python

18. HTML 35. R19

19. INI Files 36. Ruby Script Language20

20. Inno Setup Scripts16 37. SQL

21. Java 38. Standard ML

22. JavaScript/JScript 39. SynGen Msg21

23. KiXtart 40. TCL/Tk 16Inno Setup is an outstanding Setupgenerator, and it’s for free, go to http://www.jrsoftware.org/. The Setup for syn has also been created with Inno Setup. 17A combination of Inno Setup and Object Pascal. 18NSIS (Nullsoft Install System) is a free scriptable win32 installer/uninstaller system that doesn’t suck and isn’t huge, see http://nsis.sourceforge.net/. This Highlighter was written by Mariusz Jakubowski [email protected], and can be downloaded from http://www.geocities.com/hmsoftcr/ nisedt.htm. 19R is a for statistical calculations, you can get it from http://www.r-project. org/. 20Ruby is a free objectorientated Scriptlaguage, http://www.ruby-lang.org/en/index.html. 21This language is for creating new Highlighter for SynEdit. 23 FEATURES 119

41. TEX22 45. XML 42. UNIX Shell Scripts 46. One customizable Highlighter (5.10)

43. Visual Basic 47. One HTML Highlighter which sup- ports embedded CSS, JavaScript and 44. x86 Assembly PHP.

22TEX is the language with which this Manual has been created, an excellent distribution for Windows is MiKTEX, you can get it for free from http://www.miktex.org/. 24 WHAT’S PLANNED 120

24 What’s planned

• Macro Recorder, could be in one of the next versions.

• Besides FTP it should support also SCP/SSH. This will be the time to rewrite the whole FTP stuff, since it is a mess.

• Pascal (Innerfuse ) as Scriptlanguage instead of the Microsoft Script control, maybe with a simple Debugger. Ok, I see, it already comes with Debugger :-). A STATISTICS 121

A Statistics

I’m not sure about the correctness of this statistics, it seems a bit biased, too less Library Lines and too much Project Lines. But maybe I’m wrong and I’ve really written that much lines :-/.

A.1 For syn.exe

A.1.1 Project Lines A.1.4 Routines

Metric Value Metric Value Code Lines 153812 Library Routines 571 Empty Lines 16955 Project Routines 4020 Slash Comment Lines 2653 Total Routines 4591 ANSI Comment Lines 405 Borland Comment Lines 12291 A.1.5 Variables Total Lines 186116 Metric Value Library Variables 12 A.1.2 Library Lines Project Variables 248 Metric Value Total Variables 260 Code Lines 11962 Empty Lines 900 A.1.6 Constants Slash Comment Lines 9 ANSI Comment Lines 8 Metric Value Borland Comment Lines 1555 Library Constants 1165 Total Lines 14434 Project Constants 9241 Total Constants 10406

A.1.3 Total Lines A.1.7 Classes Metric Value Code Lines 165774 Metric Value Comment Lines 16921 Library Classes 41 Empty Lines 17855 Project Classes 458 Total Lines 200550 Total Classes 499 A STATISTICS 122

A.1.8 Interfaces A.1.9 Records Metric Value Metric Value Library Interfaces 1 Library Records 99 Project Interfaces 170 Project Records 785 Total Constants 171 Total Records 884 B SYN DEVELOPERS 123

B syn Developers

The Developers of syn are:

Name Email Function Stefan Ascher [email protected] Developer Danail Traichev [email protected] Developer Mathias Michel [email protected] Developer Fl´avio Etrusco [email protected] Developer Fran¸cois Rivierre [email protected] Webmaster C CREDITS AND CONTRIBUTORS 124

C Credits and Contributors

This program was written using Borlands (http://www.borland.com/) Delphi23 5 (http://www.borland.com/delphi/).

SynEdit Editor Component: (http://synedit.sourceforge.net/) There are to many contributors to list them here, please refer to the website to see them.

ToolBar2000: Jordan Russel (http://www.jrsoftware.org/) used as Toolbars, Menubar and for the dockable windows.

Parts from the Consoleredirection: Maxime Collomb (maxime [email protected]) used to capture the output from consoleprograms.

Internet Direct (Indy): (http://www.nevrona.com/indy/) used for the FTP Client.

Jedi Code Library: (http://www.delphi-jedi.org/Jedi:CODELIBJCL) everywhere are functions used from the JCL.

Perl Highlighter: The best Perl Highlighter I’ve ever seen was made by Murad Kak- abayev (http://mps.wallst.ru/indexen.htm, murad [email protected]).

NSIS Highlighter: was written by Mariusz Jakubowski [email protected].

Customizeable Highlighter: Jan Verhoeven (http://jansfreeware.com/jfdelphi.htm) is a modified version from his SynAnySyn.

Regular Expression Library: Andrey V. Sorokin (http://anso.da.ru/) used in the Grep Search program.

Spell Checker: Jacob Dybala, http://www.synspellcheck.prv.pl/.

AutoCorrect Component: Aaron Chan, http://www.freeasphost.co.uk/asw/.

Script Control Wrapper: Vladimir Gaitanoff, http://www.tsinet.ru/˜vg/.

CorelButton: Peter Theill, ConquerWare The flat buttons found in all dialogs.

23Delphi is a Rapid Application Development (RAD) Tool, which uses the Pas- cal programming language with some extensions. If you’re interested in Del- phi, there is a free version, Delphi 6 Personal Edition, you can download it from http://www.borland.com/delphi/personal/del6personal keyanddown steps.html. C CREDITS AND CONTRIBUTORS 125

Color Picker Button: Dipl. Ing. Mike Lischke (http://www.lischke-online.de/) found in the Options and Page Setup Dialogs.

Parts from the TreeView for the File Explorer: Leo D. Shih ([email protected]).

HTML Help API: Igor Glukhov (http://www.igweb.pair.com/) used to call HTML Help files.

Inno Setup: Jordan Russel (http://www.jrsoftware.org/) used as Setup Program.

Programicon and Bitmap in the Abountbox: Mark Carson and Markus.

Designed with syn Icons: Argantas (http://zeme-prizraku.korab.cz/).

This Manual was created using MiKTeX (http://www.miktex.org/) and TeXnicCen- ter (http://www.toolscenter.org/products/texniccenter/).

Thanks to all this guys and companies for their great work, and, of course, to all users with their great suggestions and bugreports, especially to Mathias Michel! D CONTACT 126

D Contact

Users Mailinglist: [email protected] Internet: http://syn.sourceforge.net/

If you want to contact us due to problems concerning syn, please send an Email to the Users Mailinglist and include some additional informations:

• Programname and Version (e.g. syn Version 1.4.0),

• Operating System plus Servicepacks (e.g. Win NT 4.0 SP5),

• Systemlanguage (e.g. English (USA)),

• if there is an Errormessage, a Screenshot from this Message should help.

• and other things, you think which can be useful.

Maybe you should have a look whether there is a newer version from this program as you’re using. E MOZILLA PUBLIC LICENSE VERSION 1.1 127

E Mozilla Public License Version 1.1

E.1 Definitions.

1.0.1. “Commercial Use” means distribution or otherwise making the Covered Code available to a third party.

1.1. “Contributor” means each entity that creates or contributes to the creation of Modifications.

1.2. “Contributor Version” means the combination of the Original Code, prior Mod- ifications used by a Contributor, and the Modifications made by that particular Contributor.

1.3. “Covered Code” means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.

1.4. “Electronic Distribution Mechanism” means a mechanism generally accepted in the software development community for the electronic transfer of data.

1.5. “Executable” means Covered Code in any form other than Source Code.

1.6. “Initial Developer” means the individual or entity identified as the Initial De- veloper in the Source Code notice required by Exhibit A.

1.7. “Larger Work” means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.

1.8. “License” means this document.

1.8.1. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.

1.9. “Modifications” means any addition to or deletion from the substance or struc- ture of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:

A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. E MOZILLA PUBLIC LICENSE VERSION 1.1 128

B. Any new file that contains any part of the Original Code or previous Modifi- cations.

1.10. “Original Code” means Source Code of computer software code which is de- scribed in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.

1.10.1. “Patent Claims” means any patent claim(s), now owned or hereafter ac- quired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.

1.11. “Source Code” means the preferred form of the Covered Code for making mod- ifications to it, including all modules it contains, plus any associated interface def- inition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor’s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.

1.12. “You” (or “Your”) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities,“You”includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.

E.2 Source Code License.

2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world- wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:

(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Mod- ifications, and/or as part of a Larger Work; and E MOZILLA PUBLIC LICENSE VERSION 1.1 129

(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Ini- tial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.

2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license

(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifica- tions made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifi- cations made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Con- tributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. E MOZILLA PUBLIC LICENSE VERSION 1.1 130

E.3 Distribution Obligations.

3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients’ rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.

3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are re- sponsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.

3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent state- ment that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.

3.4. Intellectual Property Matters .

(a) Third Party Claims. If Contributor has knowledge that a license under a third party’s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must in- clude a text file with the Source Code distribution titled “LEGAL” which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge E MOZILLA PUBLIC LICENSE VERSION 1.1 131

after the Modification is made available as described in Section 3.2, Contrib- utor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropri- ate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor . If Contributor’s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor’s Modifications are Contributor’s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.

3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients’ rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.

3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code ver- sion of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, E MOZILLA PUBLIC LICENSE VERSION 1.1 132

related documentation or collateral in which You describe recipients’ rights relat- ing to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient’s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.

3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.

E.4 Inability to Comply Due to Statute or Regulation.

If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.

E.5 Application of this License.

This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. E MOZILLA PUBLIC LICENSE VERSION 1.1 133

E.6 Versions of the License.

6.1. New Versions. Netscape Communications Corporation (“Netscape”) may pub- lish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.

6.2. Effect of New Versions. Once Covered Code has been published under a par- ticular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.

6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases “Mozilla”, “MOZILLAPL”, “MOZPL”, “Netscape”, “MPL”, “NPL” or any confus- ingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Con- tributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)

E.7 DISCLAIMER OF WARRANTY.

COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN “AS IS” BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, IN- CLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PER- FORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVEL- OPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECES- SARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WAR- RANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. E MOZILLA PUBLIC LICENSE VERSION 1.1 134

E.8 TERMINATION.

8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.

8.2. If You initiate litigation by asserting a patent infringement claim (excluding de- clatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as “Par- ticipant”) alleging that:

(a) such Participant’s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Par- ticipant terminate prospectively, unless if within 60 days after receipt of no- tice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant’s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.

8.3. If You assert a patent infringement claim against Participant alleging that such Participant’s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in deter- mining the amount or value of any payment or license. E MOZILLA PUBLIC LICENSE VERSION 1.1 135

8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.

E.9 LIMITATION OF LIABILITY.

UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIB- UTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITH- OUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COM- MERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL IN- JURY RESULTING FROM SUCH PARTY’S NEGLIGENCE TO THE EXTENT AP- PLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CON- SEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.

E.10 U.S. GOVERNMENT END USERS.

The Covered Code is a “commercial item,” as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of “commercial computer software” and “commercial computer software documentation,” as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.

E.11 MISCELLANEOUS.

This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed E MOZILLA PUBLIC LICENSE VERSION 1.1 136 only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides oth- erwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys’ fees and expenses. The ap- plication of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.

E.12 RESPONSIBILITY FOR CLAIMS.

As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.

E.13 MULTIPLE-LICENSED CODE.

Initial Developer may designate portions of the Covered Code as “Multiple-Licensed”. “Multiple-Licensed” means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.

EXHIBIT A -Mozilla Public License.

“The contents of this file are subject to the Mozilla Public License Version 1.1 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. E MOZILLA PUBLIC LICENSE VERSION 1.1 137

The Original Code is . The Initial Developer of the Original Code is . Portions created by are Copyright (C) . All Rights Re- served. Contributor(s): . Alternatively, the contents of this file may be used under the terms of the license (the“[ ] License”), in which case the provisions of [ ] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [ ] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [ ] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [ ] License.” [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] F GNU FREE DOCUMENTATION LICENSE 138

F GNU Free Documentation License

Version 1.1, March 2000

Copyright c 2000 , Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The purpose of this License is to make a manual, textbook, or other written document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of “”, which means that derivative works of the doc- ument must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, be- cause free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

F.1 Applicability and Definitions

This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. F GNU FREE DOCUMENTATION LICENSE 139

A“Secondary Section”is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely avail- able drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not “Transparent” is called “Opaque”. Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LATEX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modifica- tion. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only. The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text. F GNU FREE DOCUMENTATION LICENSE 140

F.2 Verbatim Copying

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies.

F.3 Copying in Quantity

If you publish printed copies of the Document numbering more than 100, and the Doc- ument’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they pre- serve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer- network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated F GNU FREE DOCUMENTATION LICENSE 141 location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

F.4 Modifications

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

• Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.

• List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).

• State on the Title page the name of the publisher of the Modified Version, as the publisher.

• Preserve all the copyright notices of the Document.

• Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.

• Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.

• Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice. F GNU FREE DOCUMENTATION LICENSE 142

• Include an unaltered copy of this License.

• Preserve the section entitled “History”, and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.

• Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.

• In any section entitled “Acknowledgements” or “Dedications”, preserve the sec- tion’s title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.

• Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.

• Delete any section entitled “Endorsements”. Such a section may not be included in the Modified Version.

• Do not retitle any existing section as “Endorsements” or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles. You may add a section entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties – for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. F GNU FREE DOCUMENTATION LICENSE 143

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give per- mission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

F.5 Combining Documents

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled “History” in the various original documents, forming one section entitled“History”; likewise combine any sections entitled “Acknowledgements”, and any sections entitled “Dedications”. You must delete all sections entitled “Endorsements.”

F.6 Collections of Documents

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various docu- F GNU FREE DOCUMENTATION LICENSE 144 ments with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individ- ually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

F.7 Aggregation With Independent Works

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an “aggregate”, and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Doc- ument, then if the Document is less than one quarter of the entire aggregate, the Doc- ument’s Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.

F.8 Translation

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with trans- lations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.

F.9 Termination

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or F GNU FREE DOCUMENTATION LICENSE 145 distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

F.10 Future Revisions of This License

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Docu- ment specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

Copyright c YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documenta- tion License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A copy of the license is included in the section entitled “GNU Free Documentation License”.

If you have no Invariant Sections, write “with no Invariant Sections” instead of saying which ones are invariant. If you have no Front-Cover Texts, write“no Front-Cover Texts” instead of “Front-Cover Texts being LIST”; likewise for Back-Cover Texts. F GNU FREE DOCUMENTATION LICENSE 146

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free , such as the GNU General Public License, to permit their use in free software. NOMENCLATURE 147

Nomenclature

ANSI American National Standard Institute

BOL Begin of Line

EOL End of Line

IDE Integrated Development Environment, integrated because it should integrate more programs (Editor, Compiler, Debugger etc.) into one

MDI Multiple Document Interface, which means that you can have more Documents within one Program

OEM Original Equipment Manufacturer LIST OF FIGURES 148

List of Figures

1 Compiler Output from FreePascal ...... 6 2 ConfigureProfiles...... 7 3 EditProfiles...... 9 4 DefaultProfile...... 10 5 DosConsole.RUN.BAT Sample session ...... 20 6 Autocomplete List ...... 30 7 SearchTextDialog ...... 34 8 FindinFilesDialog...... 36 9 Find in Files Search Results ...... 36 10 ReplaceTextDialog ...... 37 11 GotoDialog...... 38 12 SavetoFTPDialog...... 41 13 FTP Browse Dialog ...... 43 14 EditorPopupMenu...... 50 15 Window Bar Popup Menu ...... 51 16 Output Window Popup Menu ...... 52 17 Popup Menu for the Marker List ...... 53 18 FileExplorer ...... 56 19 Workspace...... 57 20 StatusBarandWindowBar...... 59 21 OptionsDialog ...... 60 22 OptionsAutocomplete ...... 69 23 Page Setup Dialog Margins ...... 74 24 Page Setup Dialog Header/Footer ...... 75 25 CustomizeToolbars...... 76 26 Customize Keyboard ...... 77 27 Customize Mouse ...... 78 LIST OF FIGURES 149

28 CustomizeOptions ...... 79 29 ParametersDialog ...... 82 30 NewDialog:PlainFile ...... 84 31 New Dialog: Templates ...... 84 32 WelcomeDialog...... 85 33 ConfigureToolsDialog ...... 86 34 SaveDialog ...... 88 35 ConfirmReplaceDialog ...... 89 36 Marker Dialog (Add Marker) ...... 90 37 WindowsDialog...... 91 38 SynTrayMenu ...... 107 LIST OF TABLES 150

List of Tables

1 Output Expression ...... 11 2 VariableExamples ...... 17 3 Metacharacters for Regular Expressions ...... 104 4 Escape Sequences ...... 105 Index

Symbols Delete Word ...... 33 $[ActiveDocExt] ...... 16 Duplicate Lines ...... 33 $[ActiveDocLongNoExt] ...... 15 Join Lines ...... 33 $[ActiveDocLong] ...... 15 Select Line ...... 33 $[ActiveDocPathLong] ...... 16 Select to BOL ...... 33 $[ActiveDocPathShort] ...... 16 Select to EOL ...... 33 $[ActiveDocShortNoExt] ...... 15 Select Word ...... 33 $[ActiveDocShort] ...... 15 Split Line ...... 33 $[ActiveDocTitleLong] ...... 15, 16 All Commands ...... 91 $[ActiveDocTitleShortNoExt] ...... 16 Allow UI ...... 65 $[ActiveDocTitleShort] ...... 15 ANSI ...... 32 $[CurWord] ...... 16 Append Copy ...... 31 $[FileNameLong:?0] ...... 16 Append Cut ...... 31 $[FileNameShort:?0] ...... 16 Apply ...... 74 $[ModFiles] ...... 16 ASCII mode ...... 42 $[ProgramPathLong] ...... 16 asgrep ...... 108 $[ProgramPathShort] ...... 16 Commandline ...... 108 $[ProjectFileLong] ...... 15 Configurationfile ...... 109 $[ProjectFileShort] ...... 15 Credits ...... 111 $[ProjectPathLong] ...... 15 Introduction ...... 108 $[ProjectPathShort] ...... 15 License ...... 108 $[Prompt:0] ...... 16 Results ...... 111 $[SysDirShort] ...... 16 AskSaveFile ...... 18 $[TempDirShort] ...... 16 Associations ...... 63 $[WinDirShort] ...... 16 Autocomplete ...... 27 {$DateTime} ...... 17, 22 Popup List ...... 29 {$File:<filename>} ...... 17 Autocorrect ...... 71 {$File:filename} ...... 22 AutoCorrect ...... 124 {$Sel} ...... 17, 22 B A Batch files ...... 14 Add Marker ...... 53 BCC ...... 12 Add to Project ...... 23 Block ...... 32 Advanced ...... 33 Comment ...... 33 Delete Lines ...... 33 Decrease Indent ...... 32 Delete to BOL ...... 33 Increase Indent ...... 32 Delete to EOL ...... 33 Save ...... 33

151 INDEX 152

Sort ...... 33 Mouse ...... 77 Uncomment ...... 33 Options ...... 78 Bookmark Files ...... 44 Toolbars ...... 76 Borland C++Builder ...... 12 Cut ...... 31 Bound Commands ...... 92 Bugs ...... 115 D Date/Time Format ...... 61 C Default Profile ...... 9 Change Case ...... 32 Default Scriptengine ...... 65 Capitalize ...... 32 Delete ...... 31, 33 Invert Case ...... 32 Delete Marker ...... 53 Lower Case ...... 32 Delphi ...... 124 Sentensize ...... 32 Delphi Form Files ...... 21 Upper Case ...... 32 DetachedProc ...... 19 Check Spelling ...... 31 Dialogs ...... 82 Clear List ...... 52 DiskPart.RUN.txt ...... 17 CmdLine ...... 18 DosConsole.RUN.BAT ...... 17 Codepages ...... 32 Double-Click Event ...... 77 Color Picker Button ...... 125 Commandline Switches ...... 98, 107 E CommentStyle ...... 25 Edit ...... 54 Common Controls ...... 114 Edit Marker ...... 53 Configure Tools ...... 83 Editcommands ...... 30 Confirm Replace ...... 88 Editor General ...... 67 Console ...... 15, 17 Editoroptions ...... 72 Constants ...... 25 Encoding ...... 32 Contact ...... 126 Environment ...... 83 Copy ...... 31 Environment Variables ...... 14 Copy all ...... 52 Escape Sequences ...... 105 Copy Line ...... 52 Events ...... 66 Copyright ...... 2 Execute an Editcommand ...... 22 CorelButton ...... 124 ExitCommand ...... 18 Credits ...... 124 F Ctags ...... 38, 70 FDL ...... 138 Location ...... 39 Features ...... 116 Parser ...... 38 File Explorer ...... 42, 55 CurDir ...... 18 File Properties ...... 89 Custom Highlighter ...... 25 File Versions ...... 90 Customize ...... 76 Files ...... 80 Keyboard ...... 77 FileTree ...... 125 INDEX 153

Find ...... 34 Insert a String ...... 22 Find in Files ...... 35 Insert Date/Time ...... 31 Footer ...... 74 Insert File ...... 31 Format ...... 31 Insert String ...... 22 Ansi to OEM ...... 32 Install ...... 4 Encoding ...... 32 Installation ...... 4 Leading Space to Tabs ...... 32 Introduction ...... 1 Leading Tabs to Space ...... 31 OEM to Ansi ...... 32 J Space to Tabs ...... 31 Java ...... 11 Tabs to Space ...... 31 JCL ...... 124 Trim trailing Spaces ...... 32 JDK ...... 11 FTP ...... 40, 66 Jikes ...... 12 Future ...... 120 Jump to ...... 53 Jump to Line ...... 52 G General ...... 61, 80 K GhostScript ...... 25 Keyboard ...... 77 GNU Free Documentation License . . . 138 Keyboard Map ...... 91, 93 Go to ...... 37 Edit ...... 94 Go to last Change ...... 38 File ...... 93 Goto next Output Item ...... 52 Help ...... 97 Goto next Output Item ...... 38 Project ...... 96 Goto previous Output Item ...... 38, 52 Run ...... 96 Grep Search ...... 35 Script ...... 96 Gutter ...... 73 Search ...... 95 Tools ...... 97 H View ...... 96 Header ...... 74 Window ...... 97 Header/Footer ...... 74 Keys ...... 25 Helpfile ...... 40 HHCtrl.ocx ...... 114 L Hide ...... 51 Landscape ...... 63 Highlighter ...... 68 LangName ...... 25 HTML Help ...... 125 Launch Program ...... 21 HTML Tidy ...... 6, 14 License ...... 3 HTMLDOC ...... 25 Limit to one Instance ...... 24 Limitations ...... 115 I Line ...... 33 Incremental Search ...... 35 Load Scripts at Startup ...... 66 Indy ...... 124 INDEX 154

M P Main ...... 54 Pagesetup ...... 74 Margins ...... 74 Header/Footer ...... 74 Mark all Matches ...... 34 Margins ...... 74 Marker Dialog ...... 88 Parameters ...... 80, 82 Menus ...... 45 Parser ...... 38 Edit ...... 46 pascal.dci ...... 29 File ...... 45 Paste ...... 31 Help ...... 49 PDF ...... 25 Project ...... 47 Perl Highlighter ...... 124 Run ...... 47 Plans ...... 120 Script ...... 47 Popup List ...... 29 Search ...... 46 Portrait ...... 63 Tools ...... 48 PostScript ...... 25 View ...... 46 Print ...... 63 Window ...... 48 Print Preview ...... 91 Messages ...... 100 PrintInput ...... 18 Metacharacters ...... 104 Priority ...... 53 MiKTeX ...... 125 Problems ...... 115 Modified ...... 31 Profiles ...... 6, 81 Monitor for external changes ...... 24 Program Options ...... 60 Mouse ...... 77 Associations ...... 63 Mozilla Public License ...... 3, 127 Autocorrect ...... 71 MPL ...... 127 Ctags ...... 70 MRU Filelist ...... 61 Editor General ...... 67 msscript.ocx ...... 114 Editoroptions ...... 72 FTP ...... 66 N General ...... 61 New Dialog ...... 83 Gutter ...... 73 Notify only ...... 24 Highlighter ...... 68 Print ...... 63 O Run ...... 64 Objects ...... 25 Scripts ...... 65 OEM ...... 32 Shortcuts ...... 73 Open from FTP ...... 40 Spell Checker ...... 71 Options ...... 78 Syntaxhighlight ...... 68 Orientation ...... 63 Tools ...... 66 Output Expr...... 10 View ...... 62 Output Expression ...... 10 Project ...... 54 Output Window ...... 55 Projectoptions ...... 80 INDEX 155

Files ...... 80 Select All ...... 31 General ...... 80 Send ...... 19 Profiles ...... 81 Shortcuts ...... 73 Tools ...... 81 Show Active ...... 58 Projects ...... 22 Show Caret ...... 38 Projecttools ...... 81 Show full Path ...... 61 Prompt to reload ...... 24 ShowWindow ...... 18 Spell Checker ...... 71, 124 R Statistics ...... 121 RC.EXE ...... 14 Status Bar ...... 58 Read only ...... 31 StdIn ...... 15 Reconnect ...... 42 String Delimiter ...... 25 Redo ...... 30 Switches ...... 25, 98 Refresh ...... 51 synclp ...... 112 Regular Expressions ...... 102 Commandline ...... 112 Details ...... 102 Introduction ...... 112 Examples ...... 102 License ...... 112 Reload without prompting ...... 24 SynEdit ...... 124 Remove from Project ...... 23 synhigh.ini ...... 25 Repair ...... 5 synsetup.exe ...... 4 Replace ...... 37 Syntaxhighlight ...... 68 Replace in Files ...... 35 SynTray ...... 106 Report Count ...... 37 Commandline ...... 107 Requirements ...... 114 Menu ...... 106 Rterm.RUN.r ...... 17 Run ...... 6, 54, 64 T Run File ...... 6 TeXnicCenter ...... 125 Run Project ...... 6 Tidy ...... 6 RunProfile ...... 9 Toolbar2000 ...... 124 Toolbars ...... 54, 76 S Edit ...... 54 Save Dialog ...... 87 File Explorer ...... 55 Save to File ...... 52 Main ...... 54 Save to FTP ...... 40 Output Window ...... 55 SBM ...... 62 Project ...... 54 Scope ...... 35 Run ...... 54 Script ...... 54 Script ...... 54 Script Control ...... 114 Status Bar ...... 58 Scripts ...... 65 Tools ...... 55 Searchcommands ...... 34 Window ...... 55 Select ...... 33 INDEX 156

Window Bar ...... 58 Workspace ...... 55 Tools ...... 21, 55, 66, 81 Execute an Editcommand ...... 22 Insert a String ...... 22 Launch Program ...... 21 ToOutput ...... 18 Trademarks ...... 2

U Undo ...... 30 Uninstall ...... 4 Update ...... 4 Upgrade ...... 4 Usage ...... 6 Use save Subset ...... 66

V Variables ...... 15 View ...... 62

W Welcome Dialog ...... 83 Window ...... 55 Window Bar ...... 58 Windows ...... 82 Windows Dialog ...... 90 Workingdirectory ...... 82 Workspace ...... 55