User Defined Language - BASIC comments
I’ve been writing and maintaining some code for an ancient piece of hardware that is coded in a proprietary version of BASIC. Notepad++, with its UDL features, has been a godsend for making this task productive.
One issue has been bugging me, however. This version of BASIC only supports marking comments with the REM keyword. I’ve defined a comment line style with REM as the “Open” tag. This mostly works, except it also picks up any time the letters REM appear together elsewhere in the code (including in the middle of a variable name) and thinks that’s the beginning of a comment.
Is there any way to tell Notepad++ to require REM to appear as a standalone word in order to be recognized as a comment?
I’m guessing the answer is “no,” in which case I’d like to make that a feature request.
Comment & Numbertab of the UDL, just above where you define the
Comment Line Style, there is an option
Line comment positionwhich needs to be set to ☑
Force at beginning of line.
what about “allow preceding whitespace flag”, seems to work.
Thanks for the suggestions. I tried both of those.
☑ Force at beginning of line doesn’t cover cases when
REMis indented (not in the first column).
☑ Allow preceeding whitespace takes care of that, but it misses cases where
REMappears at the end of a line, like this:
LCD_Display( "Hello World" ) : REM Write text to the LCD
☑ Allow anywhere is the only option that catches all the comments, but it also catches things that aren’t comments, like:
PressureMultiplier = 3.14159 * Infinity + 42
* Real variable name in my code. Rest obviously contrived.
The keywords lists support keywords with whitespace by enclosing them in single quotes, but that doesn’t appear to be supported for comments.
I see what you mean - what comes into my mind is
either you make REM unique by adding a char like semicolon,
hopefully this is allowed by the compiler, or you make sure that
REM is the only UPPERCASE version of the source code and disable