Using Notepad++

From SysCAD Documentation
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Navigation: User Guide ➔ Editors and Utilities ➔ Notepad++

Related Links: PGMs, PGM Introduction


NOTE: While Notepad++ is still fully supported, from Build 139.32530 we recommend the use of VS Code as a more modern and fully-featured code editor.

Introduction

Notepad++ is an excellent alternative to the default Windows Notepad for writing control files (PGM and MP), as well as Archive Reporter configuration files (SAC).

We recommend SysCAD users install Notepad++ (see http://notepad-plus-plus.org) as it makes viewing and editing code much easier.

Notepad++ is free to download and install under the GPL (GNU General Public License).

NOTES:

  1. Function auto-completion and tips are only available with Notepad++ version 6.3 and later.
  2. Please download the latest version of Notepad++ and the required SysCAD xml files from our download site (https://www.syscad.net/login/), if you do not have all of the files described below.

Notepad++ Features

  1. Display line numbers
  2. Colour coding of keywords, normal code, comments etc.
  3. Colour Themes: light or dark mode.
  4. Auto-complete for SysCAD keywords and functions.
  5. Drag and drop editing for copying and moving between documents.
  6. Block (column) selection mode, and visible display of tabs and spaces.
  7. Text can be automatically aligned and indented, relative to previous line, to aid block indentation.
  8. Highlight all occurrence of the current selection for easy debugging of logic.
  9. Search and Replace in Files (for multi-file editing).
  10. Other features can be found on this site: https://notepad-plus-plus.org/online-help.

For example, comparison between Notepad and Notepad++, some features from the above list are shown in the image below:

Notepad.png

Installing Notepad++

Step 1: Locate Notepad++ Install File

Notepad++ and the relevant User Defined Language Files for SysCAD can be found in one of the following locations:
  1. Included with the SysCAD Install:
    • After SysCAD is installed, the Notepad++ install package can be found in folder: \SysCADxxx\Setup\Notepad++\npp.xxxx.Installer
    • Depending on your operating system, select and install either the 32-bit or 64-bit version (Available from Build 139.). Do not install both versions.
  2. Downloaded from SysCAD Downloads page:
    • Downloads page > SysCAD 9.3 (requires Username and Password) > Notepad++ (Install File) and SysCAD Notepad++ Files (User Defined Language Files).
Users can also check for the latest version of Notepad++ at http://notepad-plus-plus.org

Step 2: Run the Install File

Once you have located the Notepad++ install file:
  1. Run the Install program
    • The default location for Notepad++ 32-bit version is C:\Program Files (x86)\Notepad++\
    • The default location for Notepad++ 64-bit version is C:\Program Files\Notepad++\
  2. You can change this location if required. If you do specify a different location, you will need to browse for the installed location in Step 5: Configuring SysCAD to use Notepad++

Step 3: Setting up Keyword highlighting

Once the install is complete, start Notepad++ and follow the steps below to enable keyword highlighting:
  1. Select Language > User Defined Language > Define your language....
  2. Click the Import Button.
  3. Import the SysCADLanguage.xml file located in SysCADxxx\Setup\Notepad++.
  4. Close and restart Notepad++ for the changes to take effect.
  5. If colours are not visible when Notepad++ restarts, go to menu option "Language" and select "SysCAD PGM (Light Mode)" from the List of User Defined Languages.
    • (Available from Build 139.32925.) SysCAD PGM (Light Mode) and (Dark Mode) are both available.
    • SysCAD PGM (Light Mode) will work well with the default white background.
    • For users using dark background, select SysCAD PGM (Dark Mode). To enable dark mode, go to Settings > Preferences > Dark Mode, then select a preferred dark theme from Settings > Style Configurator....
NOTE: If you already have Notepad++ with an older version of SysCAD languages installed, please refer to Repairing or updating User Defined Language instead.

Step 4: Setting Up Auto-complete Functions and Keywords

Once the install is complete follow the steps below to enable auto-complete functionality:
  1. Copy files containing SysCAD PGM ***.xml from the SysCADxxx\Setup\Notepad++ folder to ..\Notepad++\plugins\APIs or ..\Notepad++\autoCompletion folder depending on Notepad++ version
    • For example, if the user defined language "SysCAD PGM (Dark mode)" is being used, then make sure the matching "SysCAD PGM (Dark Mode).xml" file is copied over to auto-complete.
  2. Start Notepad++
  3. Select Settings > Preferences > Auto-Completion
  4. In older versions of Notepad++ tick the following Buttons:
    • Enable auto-completion on each input
    • Function completion
    • Function parameters hint of input
  5. In newer versions of Notepad++, set up the preferences as shown in the image below:
    Notepad++ Preferences.png
  6. Click on 'Close' and this functionality will be available for PGM and MP files.
  7. Note that you can change the preferences at any time.

Step 5: Configuring SysCAD to use Notepad++

In SysCAD, from menu Tools > General Options on the General Tab.
If Notepad++ was installed properly, then user may simply press the Select button (for PGM and/or Text/csv) and choose Notepad++ from the popup list.
GeneralOptions139.png
Once this is done, the next time you press the Edit_PGM or Edit Archive button in SysCAD, Notepad++ will start up.
Editing other types of referenced text files from SysCAD will also be in Notepad++.

Troubleshooting

Syntax Colours not Visible

  • If using Notepad++ v5.8 or earlier it is recommended to uninstall and install the latest version.

If SysCAD files do not display colours for the keywords, it is likely that the User Defined Language has not been added or configured correctly. Please restart Notepad++ and refer to Step 3: Setting up Keyword highlighting.

If colours are still not visible when Notepad++ restarts, make sure to go to Language menu and select SysCAD PGM (Light Mode) from the list of User Defined Languages.

Notepadplusplus.png

Repairing or updating User Defined Language

To update (or repair) the files required for colour syntax of SysCAD files, follow these steps:

  1. Open Notepad++.
  2. Select Language > User Defined Language > Define your language...
  3. From the User Language drop-down menu select SysCAD PGM and then click Remove (repeat for SysCAD Reaction, SysCAD Archive, as required).
  4. Close and Restart Notepad++ for the changes to take effect.
  5. Re-import the correct or updated language file, referring to Step 3: Setting up Keyword highlighting.