syn Users Manual - SourceForgesyn.sourceforge.net/manual/syn.pdf · syn Users Manual Users Manual for syn ... support for Projects etc. syn is written in Delphi (Version 5, ... 6.7

  • Upload
    ngonga

  • View
    267

  • Download
    2

Embed Size (px)

Citation preview

  • syn

    Users Manual

    Users Manual for syn Version 2.1September 23, 2003

    Stefan Ascher

  • Abstract

    This is the Document which describes syn. If you dont know how to figureout some stuff you should consult this paper.

    syn is an Open Source Text- and Programming Editor with Syntaxhighlight formany Languages, and some IDE Features, like starting a program (e.g. Compiler)and capture the output, support for Projects etc. syn is written in Delphi (Version5, Updatepack 1) for maximum performance, stability and filesize, hence it doesntrequire any bulky VC++/VB Runtime or MFC libraries!

    I tried to keep this program as general as possible, to make it useable formany purposes, but the primary intendentation is the usage in conjunction withCompilers 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 startingpointfor your own IDE written with Delphi, because the Editor part is already done.

    The documentation consits of three files, syn.pdf this document, qaa.pdfsome questions and answeres and scriptref.pdf the Script reference. Referencesin the Document will appear as blue Link, Links to Internet Sites are coloured red.To jump to the target from a Link click on it. The References show the numberfrom the section, figure or table.

  • CONTENTS I

    Contents

    1 Introduction 1

    2 Copyright 2

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

    3 License 3

    3.1 At a glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Insert String . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    5.3 Using syn as Console Window . . . . . . . . . . . . . . . . . . . . . . . 17

    5.4 Delphi Form files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

  • CONTENTS II

    5.5 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    5.5.1 Launch a Program . . . . . . . . . . . . . . . . . . . . . . . . . 21

    5.5.2 Execute an Editcommand . . . . . . . . . . . . . . . . . . . . . 22

    5.5.3 Insert a String . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    5.6 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    5.7 Monitor for external changes . . . . . . . . . . . . . . . . . . . . . . . . 24

    5.8 Limit to one Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Object Pascal . . . . . . . . . . . . . . . . . . . . 28

    5.11.2 Popup List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    5.12 Editcommands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    5.12.1 Uncategorized Commands . . . . . . . . . . . . . . . . . . . . . 30

    5.12.2 Fomat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    5.12.3 Change Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Find in Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    5.13.5 Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    5.13.6 Go to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    5.13.7 Goto previous/next Output Item . . . . . . . . . . . . . . . . . 38

    5.13.8 Go to last change . . . . . . . . . . . . . . . . . . . . . . . . . 38

  • CONTENTS III

    5.13.9 Show Caret . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    5.14 Using Ctags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    5.15 Calling a Helpfile depending on the Syntax Sheme . . . . . . . . . . . . 40

    5.16 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    5.17 File Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    5.18 Bookmark Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    6 Menus 45

    6.1 File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    6.2 Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.3 Search Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.4 View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.5 Project Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    6.6 Run Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    6.7 Script Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    6.8 Tools Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    6.9 Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    6.10 Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    6.11 Editor Popup Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Main Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    7.2 Project Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    7.3 Run Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

  • CONTENTS IV

    7.4 Edit Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    7.5 Script Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    7.6 Tools Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    7.7 Window Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    7.8 File Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    7.9 Worspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    7.10 Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    7.11 Window Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    7.12 Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Parameters Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

    12.2 New Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    12.3 Welcome Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    12.4 Configure Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    12.4.1 Launch Program . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    12.4.2 Insert String . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    12.4.3 Execute Editcommand . . . . . . . . . . . . . . . . . . . . . . 87

    12.4.4 DOS Command . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    12.5 Save Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

  • CONTENTS VI

    12.6 Confirm Replace Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    12.7 Marker Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    12.8 File Properties Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    12.9 File Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    12.10 Windows Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    12.11 Print Preview Window . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    12.12 Keyboard Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Some examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Replace Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Whats planned 120

    A Statistics 121

    A.1 For syn.exe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

    A.1.1 Project Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

    A.1.2 Library Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

  • CONTENTS VIII

    A.1.3 Total Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Mozilla Public License 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 Verbatim Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

    F.3 Copying in Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

    F.4 Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    F.5 Combining Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 about40 different Languages. Some basic IDE features are also implemented, like launching acompiler (5.1), or any other program, and redirecting the output to this program, Findin Files (5.13.4), supports projects, but the main feature is the advanced Editor withpowerful edit- and searchfunctions. For a more complete list of features please refer to23.

    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 unusualfor Programmingeditors. Sure, it would be neat for HTML Documents, but this isnta HTML Editor either. BTW. I like Notepad! If youre looking for a replacement forNotepad 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 itsterrific fast. I use syn mainly for Freeware compilers, different Scriptlanguages, but alsofor HTML Documents.

    This Program is based on the MDI Editor sample to the SynEdit Editor ComponentSuite, check it out: http://synedit.sourceforge.net/.

    If you want to link to syn use the button (syn.png, 2 KB) in the programfolder, theaddress 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 contributedessentially to the code of the program or documentation or in an other way are listedin the Credits (C) section. Without their help and work and providing all or almost allthat for free, or free for noncommercial use, syn would not be what it is now, or it wouldnot exist at all.

    Anyway, I hope youll enjoy this piece of Software, and it does not hassle you tomuch. Im studying psychology and, as such, I dont 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/.

    http://synedit.sourceforge.net/http://syn.sourceforge.net/http://www.ozemail.com.au/~nulifetv/freezip/freeware/http://www.ozemail.com.au/~nulifetv/freezip/freeware/

  • 2 COPYRIGHT 2

    2 Copyright

    synCopyright c 20002003 by the syn Developers, see Appendix B

    2.1 Trademarks

    Microsoft and Windows are trademarks of Microsoft Corporation, Delphi is a Trademarkof Borland Corporation. All other products and company names mentioned herein maybe the trademarks of their respective owners.

    Trademarks appear throughout this document without any trademark symbol. Soyou cant assume that the names are free. There is no intentions of infringement; theusage 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 notuse this project except in compliance with the License. You may obtain a copy of theLicense 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 languagegoverning rights and limitations under the License.

    Alternatively, the contents of this file may be used under the terms of the GNUGeneral Public License Version 2 or later (the GPL), in which case the provisions ofthe GPL are applicable instead of those above. If you wish to allow use of your versionof this file only under the terms of the GPL and not to allow others to use your versionof this file under the MPL, indicate your decision by deleting the provisions above andreplace them with the notice and other provisions required by the GPL. If you do notdelete the provisions above, a recipient may use your version of this file under either theMPL or the GPL.

    3.1 At a glance

    You can do anything with it, even commercial things, but when you make changes tothe source you must publish the modified source, or a Patch file to reproduce yourmodifications. It is not necessary to publish the source of the entire project, the MPLis 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 (theFDL) Version 1.1, see Appendix F for the entire Text. You can download the Sourceof this Manual either via CVS, subdirectory manual, or you can download the Sourcedistribution from the Download page.

    http://www.mozilla.org/MPL/

  • 4 INSTALLATION 4

    4 Installation

    4.1 Install

    Run the Setup (synsetup.exe) program e.g. with a doubleclick on the file, and followthe instructions on the screen.

    If you choose to associate *.syp files with syn, youll need write access to theHKEY LOCAL MACHINE Registry key. Ordinary users are not allowed to write tothis key on Windows 2000, youll need Administrator or Power User Privileges, whenyoure using Windows 2000, Windows NT 4.0 is no problem. You will get an ErrorMessage when it is not possible to write to this key, but you can just ignore it. Thereis no other reason to be logged on as Administrator, it does not copy or replace files inyour Windows or System Directory.

    4.2 Uninstall

    This is easy: Either use the Uninstall Icon in the Startmenu, or open the Control PanelSoftware, select syn from the list and click Add/Remove. Then follow the instructionson 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 *.dcifiles, hence the Programfolder will remain on your System after uninstalling, you caneasily delete it manually, if you dont want to keep this files.

    Caution: If you uninstall syn you will loose all your settings. If you upgrade to a newerversion dont uninstall it, just run the Setup Program. It will detect automaticallyobsolete 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 thesame directory as the old version, dont uninstall previous installations. If you want torun different versions from syn, select another program directory, but note, all versionsshare the same Registry keys.

  • 4 INSTALLATION 5

    4.4 Repair

    If you want to repair an Installation, or you want to install additional Components, justrun 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 existingInstallation.

  • 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 useand configure them.

    5.1 Profiles

    It is possible to start programs with syn and capture the Output when these programsare console Programs. This makes it possible to compile a file with a Compiler (for anexample see Figure 1), or run one with a Interpreter, or you can use it to check theSyntax of a Document, e.g. HTML Documents with HTML Tidy2 .

    But first youll 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 ProjectOptions Dialog (11). Optionally you can use the Configure Command from the RunMenu to show the Configure Profiles Dialog (Figure 2) for the current Language orProject.

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

    http://www.w3.org/People/Raggett/tidy/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 Profilemay contain one or more Programs, which are executed one after the other, and oneLanguage or Project may have none or more Profiles. The count of Profiles of a Languageor Project, and the count of Programs in a Profile is in principle unlimited. This isparticular useful when a file is processed by more than only one program, e.g. compilinga Source file with a Compiler, Assembler and Linker, or running LATEX, MakeIndex andBibtex on a LATEX file. The Profiles for the Languages are saved to the Registry, andfor the Projects to the project file.

    syn has no built in Debugger, this would be cool, a Debugger for about 40 Languages;-), but Ive made this Profiles stuff as general as possible, so you can run almost everyprogram with it (btw. its a science of its own to write a Debugger, Compiler, Interpreteretc.).

  • 5 GETTING STARTED 8

    5.1.1 Configure Profiles

    It is possible to configure for each Language and Project a Program or a collection ofPrograms, so called Profiles, which you can start with the Run File or Run ProjectCommands. 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). Alternativelyyou can use the Configure Profiles Dialog (Figure 2), you can show this Dialog with theConfigure 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 ProjectCommand. 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, moreinformations 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 forCreateProcess. This makes it possible to run the Program not hidden, withoutshowing a Console window. I introduced this because Rterm doesnt show a GUIwhen it is hidden.

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

    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 Linkerin a Profile and the compilation was not successful, then there is no need to runthe 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 fromthe 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, andyou 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 Fileand Run Project command. To run another Profile than the default one use theappropriate 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 wouldnt work in thiscase, because the last character is }, which isnt part from the Profile name. It readsthis directive always from the currently active Document.

    Note: This syntax is case sensitive, the RunProfile directive as well as the Profilename, in this case Free Pascal.

    5.1.3 Output Expression

    Configuring the Output Expression will enable you to jump to the emitted errormessagefrom 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 Examplesfile.ext(100) $[FileName]\($[LineNumber]\) CSL, Delphifile.ext(100, 21) $[FileName]\($[LineNumber], $[ColNumber]\) WSHfile.ext(100,21) $[FileName]\($[LineNumber],$[ColNumber]\) Free Pascalfile.ext:100: $[FileName]:$[LineNumber]: JDK, NASMfile.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 RegularExpressions 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 itis set to the path from the Project, so it will be found in any way, even if the outputlinecontains only the filename without the path. Dont mix up the current directory forthis program and the workingdirectory for the called program. Each Process can haveits 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 Java file using Suns JDK: The commandline can look like this (youhave 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 briefdescription 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 tothe BCC program (bcb5tool.hlp) located in the help subdirectory.

    Directory:

    3Jikes is a Java Compiler from IBM, its free and you can download it fromhttp://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 itfrom http://www.borland.com/products/downloads/download cbuilder.html.

    http://www10.software.ibm.com/developerworks/project/showfiles.php?group_id=10http://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 atthe 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 caseError

    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, lets call ittest.c, it should already compile fine, and youll get a small console program. It shoulddo nothing more than emitting only:

    test.exe usage:

    If your C(++) program consists of more than only one source file you should use aMakefile and call the Make program with the Makefile, instead of calling the compilerdirectly.

  • 5 GETTING STARTED 14

    Validating HTML documents using HTML Tidy: Make a configurationfile calledconfig.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 dontwant to update the Source file, dont use this Switch. Use as Output Expressionline $[LineNumber] column $[ColNumber].

    Compiling Resource Scripts using (Microsofts) RC.EXE: Commandline (youhave 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 oneof the Run File or Run Project Commands and it will show the output from the calledprogram.

    5.1.5 Using Environment Variables

    You may use Environment variables in the Program, Arguments and Directory field.Lets assume you want to compile a Resource Script with Microsofts RC.EXE, and thisfile is placed in the Directory of Microsoft Visual Studio, 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 youve started a program in this way the Outputlist will appear, and there is aTextBox 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 theprogram 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/Checkand the Tools, but you can also use the Popup Menu to insert these variables, see Table2 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 thefileextension.

    $[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 withoutthe path and the file extension.

    $[ActiveDocTitleLong]: Long Filename from the active Document without the pathand 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 its much easier toadd one, than to remove one.

  • 5 GETTING STARTED 17

    Variable Input Result$[ProjectPathShort] C:\mydirectory\myproj.syp C:\mydire1$[ProjectPathLong] C:\mydirectory\myproj.syp C:\mydirectory$[ProjectFileShort] C:\mydirectory\myproj.syp C:\mydire1\myproj.syp$[ProjectFileLong] C:\mydirectory\myproj.syp C:\mydirectory\myproj.syp$[ActiveDocShort] C:\mydir\myfilename.html C:\mydir\myfile1.htm$[ActiveDocLong] C:\mydir\myfilename.html C:\mydir\myfilename.html$[ActiveDocShortNoExt] C:\mydir\myfilename.html C:\mydir\myfile1$[ActiveDocLongNoExt] C:\mydir\myfilename.html C:\mydir\myfilename$[ActiveDocTitleShort] C:\mydir\myfilename.html myfile1.htm$[ActiveDocTitleLong] C:\mydir\myfilename.html myfilename.html$[ActiveDocTitleShortNoExt] C:\mydir\myfilename.html myfile1$[ActiveDocTitleLongNoExt] C:\mydir\myfilename.html myfilename$[ActiveDocPathShort] C:\mydirectory\myfile.html C:\mydire1$[ActiveDocPathLong] C:\mydirectory\myfile.html C:\mydirectory$[ActiveDocExt] C:\mydirectory\myfile.html html$[ProgramPathShort] C:\programdir\myprog.exe C:\progra1$[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 definedin the Options Dialog, Page General (8.1).

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

    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 opena 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 theExit Command. To use it instead of the Command Prompt the file should look likefollows, 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 maycontain environment variables.

    CurDir: The Workingdirectory for this program.

    ExitCommand: The Command to exit this program. If you enter this command inthe 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 filesinteractively, typing every command and seeing immediately its result in Outputwindow. 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 newprocess does not have access to the console of the parent process. The new processcan call the AllocConsole function at a later time to create a new console. Thisflag cannot be used with the CREATE NEW CONSOLE flag. If 1 it uses this flagDETACHED PROCESS instead of CREATE NEW CONSOLE in CreateProcess.I introduced this property, because R runs only with this set to 1. I think Emacsdoes the same.

    Send: Any number of lines to send to the console when starting it. Each line shouldappear 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\Consoledirectory. It is useful to save such a file with the extension from the Highlighter youwant to use, e.g. if I want to run R, I want to use the R Highlighter, and thus it is savedas *.r. Before you open the Rterm.RUN.r you must modify the path to the Rterm.exeprogram. To easily start such a new session use the New Dialog, there is a ConsoleTab 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 Recentlist, so you can easy jump to entered commands and/or quickly reenter a command. Itdoes not create a Marker when ToOutput is 1, because this wouldnt be very useful,you would have in each line a Marker. You can show this Recent list with the Keycombination Ctrl+Enter. If the Caret is somewhere in the Editor a Return will bring itto the last line.

    To pause this execution use the Console Execution Menu in the Run Menu. TheDefault Shortcut for this Button is F2, but you can assign another one if you wish. Inthat mode editing of whole text is as usual, and pressing Enter works like in any othereditor. This could be very useful if you want to add one more console option in thebeginning, change current, or edit interactively made *.bat file.

    If youve created such aRUNtemplate, and you think this could be useful for otherusers 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. Wereworking on it. In the meanwhile you could start the program with the startcommand, e.g. start notepad, which is AFAIK the usual way to start a GUIprograms from a console.

    mailto:[email protected]

  • 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 its a binary file. If it is a binaryfile it will be automatically converted, so you can read it. When youve opened such afile, and you saved it, it will be converted back into a binary file. You wont see whetherits a textfile or a binary file.

    5.5 Tools

    Its possible to have custom Tools, which you can call via the Tools Toolbar, the ToolsMenu or a Hotkey. You can either launch a Program, execute an Editcommand, inserta String or execute a DOS Command with a Tool. You can assign a Shortcut to eachTool (generally to each Toolbar- and Menuitem) with the Customizedialog. There is nobuilt-in limit how many Tools you can have, but the more tools you have the slowerwill be the whole program (depending on your Computer). The Projecttools (5.6) aresimilar to the Tools, which you can configure in the Options dialog, except you cantassign a Shortcut, and there is no corresponding Menu.

    To configure this Tools use the Configure ToolsDialog (Figure 33), you can show itwith the Configure Menuitem in the Tools Menu. This Dialog is described in Section12.4.

    5.5.1 Launch a Program

    Use Launch Program as Toolkind, choose the Program, and the Workingdiretory forthis Program. You can redirect the output from console programs to syn like for the Runand Check (5.1) commands, just activate Capture Console. There is no possibility toenter a Compilermessage, so you cant 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 shouldnt checkCapture Console. For starting the active Document with the associated Program enteras filename the variable for the active Document: $[ActiveDocShort]. For a completelist of appropriate Variables for this kind of Tools and Execute DOS Command-Toolssee section 5.2.1. You should enclose the Programname in Quotes when the filenamecontains 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 Editcommandas Toolkind, and choose from the dropdown combobox theEditcommand 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 currentlyselected Text use {$Sel}. You can use the Selection Button to insert this Variable atthe current Caret position. Use Insert String as Toolkind, and enter the Text to insertin 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 toyour 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, youveto replace filename with the name from the file to insert. It is only useful to inserttextfiles of course, but you know this. For a complete list of these Variables see section5.2.2.

    5.6 Projects

    Projects are saved as ordinary ini files, but with the extension syp, you can read andmodify them with any Texteditor. You should know what youre doing when you modifysuch a file manually, of course. If you have used the Installer *.syp files are associatedwith syn, so you can open such files with a doubleclick in the Explorer. You can alsodrag a projectfile from the Explorer and drop it into the program to open it. As any

  • 5 GETTING STARTED 23

    INI file shouldnt this file exceed the 64 KB limit as well, everything exceeding this limitis truncated. Anyway, it will have to be a very large Project to exceed this limit. TheFilenames are saved with relative paths, i.e. when you move a Projectfile without all itsmembers to another folder the Program will not find the Files. You have to remove allfiles and add it again to the project.

    There are two Menuitems in the Project-, the Editor- and the Contextmenu from theWorkspace (Add to Project, Remove from Project), this Items are not visible whenno Project is opened. I dont want to bother myself with Menus I cant use (Menus aregrowing that fast!). This information is just in case, you think what a stupid Office 2000behavior. There are no other Items, which are sometimes invisible, except the RecentFiles Menu when it contains no files and the Tools Menu and Toolbar when no Toolsare configured, but this is usual behavior.

    Add to Project Menu: The submenu lists all opened documents which are notalready members of the current project. If you click on one, this file will be addedto the current project, no need to open the Project Options. The Menuitem Addall 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 ofthe current project, to remove one file from the project click on the correspondingMenuitem.

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

    Project Tools: Its possible that each project has its own Tools. This Tools actssimilar 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 cant 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 thefile has changed or not, not the string inside or the filesize. This means, you can savea 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 fileswith exact the same filesize, and comparing the filecontent will take to much time andresources (the program must open the file, read the content, and compare it). Theprogram uses the FindFirstChangeNotification et al. API functions in an externalthread to detect changes in the directory from an opened document, and compares thenthe filedate. This thread isnt created when youve deactivated this feature. You havethree 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 thenewest version. Note: all made and not saved changes will go lost, if you reloadthe file. On the other hand if you save it before reloading, the made modificationsfrom the external program will go lost.

    3. Reload without prompting: the program reloads the file without to ask youanything, 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 thesecond one terminates itself. This means youre not able to run syn more than only onetime. This can be useful in some cases, especially when youre using the SynTray (18)Program. This option is activated by default, because some features rely on it, but itsalso not problem when you deactivate it. This is possible at the General Page (8.1) inthe 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 thenear future, but you can do it with a small Workaround: There is a Freewaretool whichconverts HTML files into PDF files called HTMLDOC6 . So you can export the file to aHTML 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, butthe filesize from syn would increase dramatically, and the Acrobat Reader says for allfiles, Ive generated with this Unit, that it is corrupt.

    If you have Acrobat installed, you can use the Acrobat Distiller Printerdriver directlyfrom syn (File Print. . . ) as you would do with each other Program. You can alsoprint to a Post Script Printer7, and then convert it with GhostScript8 to PDF, which iscompletely free, and looks also quite good.

    5.10 The Custom Highlighter

    There is one highlighter, which you can use for a custom Syntaxhighlight, its calledCustom Highlighter. You can use it as an usual highlighter, but the definitions comesfrom 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 evensyn.

    Besides a list of keywords you can also define a list of constants and objects that canhave 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 2000http://www.hp.com/cposupport/printers/software/lj485en.exe.html, and for Windows 95 and 98http://www.hp.com/cposupport/printers/software/lj477en.exe.html. These are drivers for HP colorlaserjet 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.

    http://www.easysw.com/htmldoc/http://www.hp.com/cposupport/printers/software/lj485en.exe.htmlhttp://www.hp.com/cposupport/printers/software/lj477en.exe.htmlftp://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 tothis file. You can setup the colors, styles and associated Filetypes in the Optionsdialog.

    The program loads this file at startup, if youve changed it, youll need to restart theprogram to see the changes.

    5.11 Autocomplete

    This Program offers a feature to complete codefragments with hitting a Hotkey. Theinformations about how to complete the code comes from a file, which you have toconfigure in the Options Dialog Syntaxhighlight Autocomplete (8.11.2), you canedit this Templates in the Options Dialog, or you can use a Texteditor.

    You can define the Hotkey in the Optionsdialog page Shortcuts (8.16) commandecAutoCompletion (default is Ctrl+J, but I prefer Ctrl+Space in this case9).

    9Ctrl+Space is usually the Hotkey for Code Completion, hence syn doesnt support any intelligent

  • 5 GETTING STARTED 28

    The fileformat is the same as Delphi uses for this feature, its an ordinary Textfile. If you have Delphi, and youve your own file made for Delphi, you can just assignthis File instead of the shipped file. You can also use the bsb.dci file from C++Builder for the C++ Language, its the same fileformat. This file can be found inBorland\CBuilder4\bin, delphi32.dci can be found at Borland\Delphi5\bin, dependson the version youre 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 thecode. The first part is the short form and will appear in the Name Column in theListView from the Options Dialog. The second part behind the | Character is ashort description from this code, youll see this part in the Description Column in theListView. You can make or edit such a file with any Texteditor (e.g. Notepad) but itis probably easier for you to use the Options Dialog (8). Its possible to edit this filevisually at the Syntaxhiglight Page (8.11.2), see Figure 22.

    Note: You cant use the combination [|] in the code section, because the programwill think this is a header line from a code section. It will tell you that this is aninvalid fileformat, and maybe some more errors.

    kind of code completion, I use this Hotkey for the Autocompletion feature (Space is easier to find thanJ).

  • 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 youll 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 haveto use a Highlighter in order to use this feature, its not possible to use it, when noHighlighter is assigned. The Autocomplete files shipped with the Setup Program will beassigned during Install to the Highlighter. You can make, of course, for any supportedSyntaxsheme such a file and assign it to it, its 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 youvecreated such a file, or more of them for a language, and you want that I put it on thesyn Page for download for other users, send it by Mail to me. I recommend you tomake this list not too large because this may slowdown some processes. I would onlyadd the most frequently used Code snippets, but this is completely up to you and yourcomputer, 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 havent entereda Token, or it doesnt find a matching Token, it will show a Popup List with all theCode Templates for the current language. You can choose from this List a Templateand 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 formright aligned and bold, the Description is left aligned, it is very similar to Delphi. Thislist 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 doesnt 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 cant find anymore 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. WhenUndo is disabled, it is an indication that nothing needs to be undone or you cannotundo 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 replacesthe selected text with the clipboard contents.

    Delete: The delete command clears the selected text from the active document or itremoves 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 setupthe format use the Options Dialog, Page General (8.1).

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

    Modified: Toggles the Modified status of the active document.

    Read only: Toggles the read only status of the active document on and off (Read Onlyis 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 ofSpaces.

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

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

  • 5 GETTING STARTED 32

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

    OEM to Ansi: Translates the entire Document from the OEM character set into theANSI character set. Its not possible to undo this command, use the Ansi to OEMcommand instead.

    Ansi to OEM: Translates the entire Document from the ANSI character set into theOEM (original equipment manufacturer) character set. Its not possible to undothis 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 lowercase.

    Sentensize: The first Letter from each sentence is upper case, all other Letters arelower 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 its not a multiline comment (like in VB,) use not this Character.

    Uncomment: Uncomments the selected block according the Syntaxsheme. It uses thesame 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, andending 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 withoutthe 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 theLinebreak(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 nextline.

    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 amore 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 aText you want to search for. Press Enter to search the active document for the specifiedstring. The selected word in the Editor is in the Findtext field, when there are morelines selected, nothing is in the Findtext field, but the CheckBox Selected Text only isselected.

    If you activate Mark all Matches it sets a Marker for each Match, and doesnthighlight the Match. You can jumt then to the Match with a double click in the MarkerList 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 needto 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 theEditor. You can see the current Searchstring in the Editor State Statusbar Panel, seesection 7.12 for more informations about the Statusbar. A matching string is selectedin 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 theIncremental 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 FilesMenuitem in the Search Menu. A Dialog (Figure 8) will appear where you shouldenter the search criteria. After clicking Find the Output Window (Figure 9) will showup, and all Matches are written to the List. To jump to the match just double click onthe item in the list. This will open or activate the file and places the Caret in the linewhere 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 cant correctlyreplace text in binary files. Before you replace text in files you should make a backupcopy of these files. If you want to list only all files in a certain directory, which machesthe 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 inFiles 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 whichare currently opened, and All Projectfiles searches all files in the currently openedProject. The Filefilter is also used for this files, e.g. youve the Filefilter *.htm, onlyHTM 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 Textwhich should be replaced, and the Text with which it should be replaced. If you useOK youll see the Confirm Replace Dialog (Figure 35), which asks you whether youresure every time it finds a match. If you use Replace all every found match will bereplaced without asking you anything. If you have activated Report Count it tells youhow many occurrences has been replaced.

    You may also use Escape Sequences (17) for replace text, such as \n, \t, \f, \r, toreplace 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 withthe 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- andColumnposition.

  • 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 ifthe Output is a mess, and its not easy to identify a Line which matches the OutputExpression, e.g. like LaTeX output. It uses the currently selected Item in the List anditerated through the rest to find such a Match. If it finds a matching Item it selects itin 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 maybe useful when youve 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 andother 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

    http://ctags.sourceforge.net/

  • 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 foundinformations in a Toolbar.

    Where does it look for Ctags?

    1. It looks if there is an Environment Variable CTAGSBIN, if it finds there the Ctagsexecuteable 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 possiblethat you need not wait until the file is parsed, but Ctags will also be slower, and maytake some time on larger files. You shouldnt even notice that this program is runningin the background, because this way it does not consume much system resources. Ctagsis 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 optionsthis 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 numberin the parentheses is the Linenumber, the word after the colon is the Name of theTag, 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 isthe 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 assignany Helpfile in the Options Dialog (Highlighters Page, 8.11.4) and hit the F1 Key in theEditor. 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 theWord under the Caret in the Index and shows the topic when its found. If there is noWord under the Caret it will show the Contents Page from the Helpfile.

    If you dont want to search the Token under the Caret in the Index, but call a specificTopic for a specific Word, you can make a Table on which Token which Topic shouldappear. 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 wordappear, in the second the numeric Topic ID. Sure, this makes only sense, when you knowthe Topic IDs 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 showthe 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 thecommands Open from FTP and Save to FTP in the File Menu. After using one ofthis commands a Dialog (Figure 12) will appear where youll have to enter your LoginData and some other stuff.

    If you open or save a file in this way the setting are saved to the registry, and youcan use them the next time without entering them again. To edit this settings use theOption Dialog Page FTP Server (8.8). The program will show a Window during theup- or download process to indicate, that it is currently up- or downloading a file. Thedownloading process is not asynchronous, this means the program is blocked this time,and you cant use it.

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

    To open a file from a subdirectory on the Server enter in the Filename Textbox thefilename 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 thefilename, e.g. /index.htm.

    When you upload a file, the file in the Editor will be saved as a temporary file inthe 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 theuploading process.

    If youre transferring text files between Unix and Windows using FTP be sure totransfer them in ASCII mode so the ends of lines are appropriately converted.

    To browse on the FTP Server for a file use theBrowseButton (. . . ) from this dialog.This button shows a Browse Dialog (Figure 13) similar to the Open/Save dialogs fromWindows. You can create directories, delete and rename files, or just select a file. It isnot possible to delete or rename a Directory, for advanced FTP commands use a FTPClient, or, if youre familiar with the FTP Commands, use Send Command. You cansend any command to the FTP Server, if you add or remove a file/directory, youll haveto 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 afteruploading or downloading a file. This should make browsing much faster, and I think itsnot necessary to stay connected after up- or downloading a file. Staying connected wouldcause some other problems too, e.g. the FTP server logs you automatically out aftera specific time of inactivity, the program has to send a command (NOOP) to preventthis, not every Server accepts this command and this works not for an unlimited time,etc. When youre connected with the Browse Dialog, and youre not using it for a longtime, you may also be disconnected, which will give you an Errormessage, when you tryto access the Server again. You can use the Reconnect Command (F3) to find in thePopup 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 advantagethat there is no need for an additional ListView for the files.

    The File Explorer is initially invisible, this means when you start this program thefirst time you cant see it, to show it use theFile ExplorerMenuitem 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 havean other Directory, change the Workingdirectory at startup. To change the Workingdi-rectory youll need to launch syn from a Link.

    The File Explorer does not notice changes, e.g. deletion or creation from files, inthe filesystem. You can update the Explorer with the F5 key, or with the RefreshMenuitem 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 usethe Popup Menu, it appears when you rightclick on a File or Directory. You can alsoselect a File and hit then Enter. It is not possible to select more than only one File, andopen them at once.

    5.18 Bookmark Files

    syn saves by default Caret position, Marker and selection of a Document before youclose this Document, and restores it when you load this Document again. These fileshave the extension .sbm and are hidden by default. You can disable this behaviour inthe Options Dialog (8), Page General (8.1). If you want that it does not save such a filewhen 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 ofthe 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 aredescribed on other places, hence this is not a exhausting description from the commands,but youll 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 usedfilelist.

    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 onlyavailable 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 thefocus.

  • 6 MENUS 46

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

    Exit: Closes the program.

    6.2 Edit Menu

    Youll find a description from the Editcommands in section 5.12.

    6.3 Search Menu

    Youll 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 showor 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 normalview use the Hotkey (default F11) or the Fullscreen Menuitem in the contextmenufrom 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 insection 8.

  • 6 MENUS 47

    6.5 Project Menu

    New: Creates a new empty project, before youre forced to choose a filename for theproject.

    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 quicklyto the current project.

    Remove from Project: Shows a list of files which are currently a member from theopen 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 commandlinewithout changing the syntax or project settings.

    Run: Starts the program with the arguments youve defined either in the Options, orProjectoptions as Run program.

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

    Stop Process: Terminates a running process youve 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 theText in the Editor, so its not necessary to save it before.

  • 6 MENUS 48

    6.8 Tools Menu

    This is the Menu for the Tools youve configured. If you havent configured any Toolsyet, you wont 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 willbe 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 thefamiliar cascade pattern.

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

    Tile Vertically: This command arranges all the windows in the main working area sothat 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 thewindow.

    Windows: Opens the Windows Dialog (Figure 37), where open documents can beactivated, saved, closed, cascaded, tiled or minimized.

  • 6 MENUS 49

    6.10 Help Menu

    Contents: Shows this Manual, or when you havent it yet downloaded, it will ask youwhether you want to download it now.

    Keyboard Map: Shows all keyboard commands, you can see the default commandsin 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 importantsearch commands, and the Fullscreen command. If you have a project open it willhave two more Menuitems, Add to Project and Remove from Project. To show thisMenu 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, evenwhen this window is not active. You can close, minimize, save etc. it. To show thisMenu use the right Mouse Button on the desired Window Tab. If you click with theright Mouse Button on the Window Bar, bu