4DScript Syntax Highlighting in Notepad++

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
JorisGoosen
Posts: 3
Joined: Tuesday 02 June, 2015 - 16:03

4DScript Syntax Highlighting in Notepad++

Post by JorisGoosen »

Ever have one of those days where you would like to edit ED-files in a text-editor and find it hard to separate the comments from the code?

These days are luckily over! That is, when you download the attachment [attachment=0]4DScriptSyntaxHighLighting.zip[/attachment] extract the xml-file from it and start (using) Notepad++.

To activate syntax highlighting in Notepad++, open the "Language"-menu and the "Define your language.."-option.
Now you see a window with several options, the one of interest would be "Import".
Select 4DScriptSyntaxHighLighting.xml and it should now appear in the "Language"-menu.

When you open *.4ds, *.atm, *.gui or *.app files they should light up automatically but you can always manually turn it on by selecting it from the menu.

I hope someone will find this useful and if anyone improves it, post it here and Ill make sure the newest version be attached here.
Attachments
4DScriptSyntaxHighLighting.zip
(2.72 KiB) Downloaded 721 times
Chiara
Posts: 30
Joined: Thursday 20 September, 2012 - 09:40

Re: 4DScript Syntax Highlighting in Notepad++

Post by Chiara »

Hello,

thank you very much for this file, i think it's very usefull having the 4Dscript language in notepad++.

I tried, and the result is like this:
CatturaED.JPG
CatturaED.JPG (71.93 KiB) Viewed 19957 times
I can't understand why there are some words blue coloured and others green coloured...I did something wrong?

Thank you
JorisGoosen
Posts: 3
Joined: Tuesday 02 June, 2015 - 16:03

Re: 4DScript Syntax Highlighting in Notepad++

Post by JorisGoosen »

Hello Chiara,

First, let me start by assuring you that you didn't do anything wrong, the differently coloured words result from the way the syntax highlighting in notepad++ works.
The blue parts are because they come after a '[' (they are strings) but because the limited syntax highlighting in notepad++ does not understand nested strings of this kind it stops the string-highlighting after the first ']' it encounters.
For the other part, things like 'att' or 'vtp' should be highlighted, but they are defined as prefix-keywords which means that they'll take anything not separated by whitespace as being part of the keyword.

Adding some spaces to your code should light the words up though, besides that it'll make it easier to read at any rate.
Post Reply