Using Notepad++
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:
- Function auto-completion and tips are only available with Notepad++ version 6.3 and later.
- 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
- Display line numbers
- Colour coding of keywords, normal code, comments etc.
- Colour Themes: light or dark mode.
- Auto-complete for SysCAD keywords and functions.
- Drag and drop editing for copying and moving between documents.
- Block (column) selection mode, and visible display of tabs and spaces.
- Text can be automatically aligned and indented, relative to previous line, to aid block indentation.
- Highlight all occurrence of the current selection for easy debugging of logic.
- Search and Replace in Files (for multi-file editing).
- 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:
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:
- 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.
- 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).
- Included with the SysCAD Install:
- 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:
- 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++\
- 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++
- Run the Install program
Step 3: Setting up Keyword highlighting
- Once the install is complete, start Notepad++ and follow the steps below to enable keyword highlighting:
- Select Language > User Defined Language > Define your language....
- Click the Import Button.
- Import the SysCADLanguage.xml file located in SysCADxxx\Setup\Notepad++.
- Close and restart Notepad++ for the changes to take effect.
- 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:
- 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.
- Start Notepad++
- Select Settings > Preferences > Auto-Completion
- In older versions of Notepad++ tick the following Buttons:
- Enable auto-completion on each input
- Function completion
- Function parameters hint of input
- In newer versions of Notepad++, set up the preferences as shown in the image below:
- Click on 'Close' and this functionality will be available for PGM and MP files.
- 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.
- 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.
Repairing or updating User Defined Language
To update (or repair) the files required for colour syntax of SysCAD files, follow these steps:
- Open Notepad++.
- Select Language > User Defined Language > Define your language...
- From the User Language drop-down menu select SysCAD PGM and then click Remove (repeat for SysCAD Reaction, SysCAD Archive, as required).
- Close and Restart Notepad++ for the changes to take effect.
- Re-import the correct or updated language file, referring to Step 3: Setting up Keyword highlighting.