INTERACT FORUM

More => Old Versions => JRiver Media Center 22 for Windows => Topic started by: 221bBS on November 19, 2016, 05:21:42 pm

Title: Using Notepad++ to Help With Expressions
Post by: 221bBS on November 19, 2016, 05:21:42 pm
For the nth time, I'm restructuring how I use MC. And as always, I break an expression or 3 or... I don't have any experience in coding so working on expressions is a challenge for me. After looking at a broken expression for 15 minutes, I finally figure out I missed something simple. This happens a lot but using Notepad++ (https://notepad-plus-plus.org/) helps a lot. This past week, I decided to try and configure Notepad++ (https://notepad-plus-plus.org/) to help me a bit more.

I created a custom language that color codes the expressions (see Language.jpg). I figure I'd share it with everyone. Might help beginners to read expressions easier.

I've attached my custom language file (JRiver Media Center.zip) below. To install, unzip JRiverMediaCenter.zip to get  JRiver Media Center.xml. In Notepad++ (https://notepad-plus-plus.org/), click Language >Define your language... Click the Import... button and point to the JRiver Media Center.xml file. Restart Notepad++ (https://notepad-plus-plus.org/) (thanks RoderickGI (http://yabb.jriver.com/interact/index.php/topic,108016.msg749233.html#msg749233)). To run the language for the file you are looking at, click Language > JRiver Media Center.

You can have it ignore casing, i.e. ifelse is same as IfElse, by checking Ignore case next to the Export button.

Functions (blue) = Folder & Default > Folding in code 1 style and Operators & Delimiters > Operators 1
HTML (orange) = Comment & Number > Comment line style
Default Fields (purple) = Keywords Lists > 1st group
Default Fields (Display name) (light purple) = Keywords Lists > 2nd group
Custom Fields (green) = Keywords Lists > 3rd group
Custom Fields (Display name) (light green) = Keywords Lists > 4th group

Custom Fields have been left blank on export.
Title: Re: Using Notepad++ to Help With Expressions
Post by: Spike1000 on November 20, 2016, 04:18:52 am
Nice work. Thanks for sharing.

Spike
Title: Re: Using Notepad++ to Help With Expressions
Post by: astromo on November 20, 2016, 04:37:23 am
Sounds intriguing.

Thanks.
Title: Re: Using Notepad++ to Help With Expressions
Post by: glynor on November 20, 2016, 09:43:33 am
Thanks! I'd been meaning to do this for a long time, but was always too lazy. Downloading now.
Title: Re: Using Notepad++ to Help With Expressions
Post by: RoderickGI on November 20, 2016, 02:35:23 pm
Well done, and thanks for sharing. It looks like that was quite a bit of work.

Note that I had to restart Notepad++ after importing the language, before I could select it from the Language menu.
Title: Re: Using Notepad++ to Help With Expressions
Post by: 221bBS on November 20, 2016, 02:52:28 pm
Glad people find it useful. Took me a bit to figure out the best way to do this.  ;D