This linked file should generate and XML-File for Notepad++, but somehow it throws an error "XMLOpenfile" is unknown. Well that is an Igor problem and not one concering you, but still the ipf file contains stuff like
XMLsetAttr(fileID,base,"","ext","ipf") // Make this apply automatically to all .ipf files opened in the text editor.
XMLsetAttr(fileID,base+"/Settings/Global","","caseIgnored","yes") // Case insensitive
XMLsetAttr(fileID,base+"/Settings/Global","","escapeChar","\") // Escape character
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[1]","","\"00\"00") // Delimiters
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[4]","","! \" # $ & ( : ? , [ ] { } + =") // Operators
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[5]",""," 1 2 0//") // Comment
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[6]","",stringbykey("flow",words)+stringbykey("types",words)) // Words 1
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[7]","",stringbykey("functions",words)) // Words 2
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[8]","",stringbykey("operations",words)) // Words 3
XMLsetNodeStr(fileID,base+"/KeywordLists/Keywords[9]","",stringbykey("pragmas",words)) // Words 4
XMLsetAttr(fileID,base+"/Styles/WordsStyle[4]","","fgColor",stringbykey("keyword",colors)) // Keyword 1
XMLsetAttr(fileID,base+"/Styles/WordsStyle[5]","","fgColor",stringbykey("function",colors)) // Keyword 2
XMLsetAttr(fileID,base+"/Styles/WordsStyle[6]","","fgColor",stringbykey("operation",colors)) // Keyword 3
XMLsetAttr(fileID,base+"/Styles/WordsStyle[7]","","fgColor",stringbykey("pound",colors)) // Keyword 4
XMLsetAttr(fileID,base+"/Styles/WordsStyle[9]","","fgColor",stringbykey("comment",colors)) // Comment Line
XMLsetAttr(fileID,base+"/Styles/WordsStyle[12]","","fgColor",stringbykey("string",colors)) // Deliminer1
How to proceed?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't know what this XMLUtils XOP is. The program that executes the script you posted may be expecting an existing file similar to a valid userDefineLang.xml file.
If providing such a file as input doesn't work, I think I can manually assemble a syntax file from your scrit. Whether it will be complete is an open question, but at least N++ will do something useful with it.
I'll do that tonight UTC I think, and will upload on http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files
Who is the maintainer supposed to be? Could be me, but I don't know a thing about Igor lol.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I started making a new udl file from your post, but that won't ever work. Obviously there is some sort of file with the word lists for your language, and this is not available. Back to you.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-12-05
I just did it and it worked wonderfully. Here is the step-by-step. Hopefully this will work for you.
1. Download the "Syntax Highlighter.ipf" file from the link you provided (http://www.igorexchange.com/project/syntaxcolor). Extract all the files from the zip file.
2. Download the "XMLUtils XOP' from this link: http://www.igorexchange.com/project/XMLutils. Extract all the files from the zip file.
3. Install the XMLUtils XOP (check out the ReadMe.txt file included in the zip file if you need help with the install). If you are using Windows, just double click on the "XMLutilsInstaller.exe" file.
4. Open Igor
5. Open the "Syntax Highlighter.ipf" file in Igor and read the directions in the red comments at the top (the rest is described in the comments, but in case it isn't clear, I wrote the steps out for you.)
6. Basically: open Notepad++, go to View> User-Defined Dialogue> click Create New…, and name it Igor. Then, close the dialogue and close Notepad++.
7. In Igor, with the "Syntax Highlighter.ipf" file open, type "SetSyntaxColoring()" without the quotes, into the command line and press enter
8. This will open up a dialog box where you have to find a file called "userDefineLang.xml" which you created in Notepad++ when you created the new User Defined Language called Igor. On my computer, the file was located at C:\Users\"my name"\AppData\Roaming\Notepad++. Once you find the file, select it and click Open. This alters the xml file as necessary.
9. That should do it. Now open up Notepad++ and you should be able to open up a procedure file (*.ipf) and everything is colored as it should be.
Hope that clears things up.
MenaM
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
can somone generate a synthax highlighter for the scientific programming language Igor Pro?
There is some prework for Notepad++, but i dont understand this XML stuff:
http://www.igorexchange.com/project/syntaxcolor
This linked file should generate and XML-File for Notepad++, but somehow it throws an error "XMLOpenfile" is unknown. Well that is an Igor problem and not one concering you, but still the ipf file contains stuff like
How to proceed?
I don't know what this XMLUtils XOP is. The program that executes the script you posted may be expecting an existing file similar to a valid userDefineLang.xml file.
If providing such a file as input doesn't work, I think I can manually assemble a syntax file from your scrit. Whether it will be complete is an open question, but at least N++ will do something useful with it.
I'll do that tonight UTC I think, and will upload on http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files
Who is the maintainer supposed to be? Could be me, but I don't know a thing about Igor lol.
CChris
I started making a new udl file from your post, but that won't ever work. Obviously there is some sort of file with the word lists for your language, and this is not available. Back to you.
CChris
I just did it and it worked wonderfully. Here is the step-by-step. Hopefully this will work for you.
1. Download the "Syntax Highlighter.ipf" file from the link you provided (http://www.igorexchange.com/project/syntaxcolor). Extract all the files from the zip file.
2. Download the "XMLUtils XOP' from this link: http://www.igorexchange.com/project/XMLutils. Extract all the files from the zip file.
3. Install the XMLUtils XOP (check out the ReadMe.txt file included in the zip file if you need help with the install). If you are using Windows, just double click on the "XMLutilsInstaller.exe" file.
4. Open Igor
5. Open the "Syntax Highlighter.ipf" file in Igor and read the directions in the red comments at the top (the rest is described in the comments, but in case it isn't clear, I wrote the steps out for you.)
6. Basically: open Notepad++, go to View> User-Defined Dialogue> click Create New…, and name it Igor. Then, close the dialogue and close Notepad++.
7. In Igor, with the "Syntax Highlighter.ipf" file open, type "SetSyntaxColoring()" without the quotes, into the command line and press enter
8. This will open up a dialog box where you have to find a file called "userDefineLang.xml" which you created in Notepad++ when you created the new User Defined Language called Igor. On my computer, the file was located at C:\Users\"my name"\AppData\Roaming\Notepad++. Once you find the file, select it and click Open. This alters the xml file as necessary.
9. That should do it. Now open up Notepad++ and you should be able to open up a procedure file (*.ipf) and everything is colored as it should be.
Hope that clears things up.
MenaM
This is the XML file it generated:
-MenaM