![]() |
Forum Index : Microcontroller and PC projects : Notepad++ and MM.Basic
Page 1 of 4 ![]() ![]() |
|||||
Author | Message | ||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Like some other forum users I've been using notepad++ for a while now. Once programs get to around 40 plus functions and procedures I was really missing procedure and function folding of other languages and editors. I also wanted full colour syntax highlighting for all of the Armmite H7 and Maxmite commands etc., so it was nice to get notepad++ working with MM.BASIC on both counts as it really makes coding and spotting syntax errors a breeze. Now I've finally made a start on adding automatic pop-up (as you type) command usage syntax hints for each function, procedure and keyword. It's just taking a long time to do it. I was wondering if others had already done this as it would save me a lot of time, otherwise I'll just keep plugging away and adding them as I go along. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
Paul_L Guru ![]() Joined: 03/03/2016 Location: United StatesPosts: 769 |
@Mike ... Did you say that you actually got notepad++ working with MM.BASIC syntax and code folding????!!!! I had been trying to do that for over a year. I gave up. The closest I've been able to get is to use the default Visual Basic color highlighting. I couldn't get code folding to work worth a darn. Would you care to share what you have done? Paul in NY |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1003 |
I looked at notepad++ and was prompted to update. I looked under language menu and MMbasic is there, seems to have keywords and folding.I did not do it. Where did it come from? Is it from you Mike. How does it all work? Gerry Latest F4 Latest H7 FotS |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Hi Paul, yes full MM.BASIC syntax highlighting, Function folding and Auto MM.BASIC command syntax declaration as you type, that's only partially done as I'm adding to it as I go along as health issues have slowed me a lot for the past 6 months. Note that I only fold Functions/Procedures, I don't want to fold IF-THEN or DO LOOP sections of code inside the functions, I know some people want that but I can't imagine why. I also got around the problem of having EXIT SUB's inside a Procedure, same deal with Functions when code folding. Correct colour syntax highlighting just makes everything so incredibly easy to read and uncluttered. Happy to share the USerDefineLang.xml and associated files. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Hi Gerry, that's interesting as I have the latest version and there is no MMBasic in mine? Would be nice if it was as only the code specific changes for the various boards like the ARM boards would have to be added, although I doubt it would have auto syntax usage. BTW My Ver is 7.6.2 1 Jan 2009. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Love to see it Mike, I played around with similar stuff 18 months ago, but had a lot of unresolved issues. Did like having a function list though. Few of the files I created in this post. Cheers |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1003 |
Mystery solved. I must have downloaded Phils stuff and not remembered! Latest F4 Latest H7 FotS |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
I though that may have been the case as I vaguely remember a post about this subject some time ago ![]() EDIT: Well there you go Phil posted the link above. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Hi Phil, I've just had a look at your post, first off, I'm not using the View Function List option, for me it's not needed, with code folding the main editor page is the function list and the only functions/procedures unfolded would be the one or two that I'm currently editing. The only code not folded is the Main "DO LOOP" at the head of the Procedure/Function code, which is exactly what I want, along with the various set-up options, variables and pin decelerations at the top of the file. If this is suitable for your use then I'll get them together when I get home and post a link. The other thing to keep in mind is that I'm basically leaning towards the ARMmite H7. I've just started to mark the commands specific to the H7 in the function hints, but that hint list is early days as I've spent time finding the best way to make it work and be usable within the silly limitations of the script Parser in NP++. Mike NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
Paul_L Guru ![]() Joined: 03/03/2016 Location: United StatesPosts: 769 |
Trying out your USerDefineLang.xml and associated files would be greatly appreciated! That version number is weird. Mine is 7.5.9 (32 bit) with a build date of Oct 14 2018. I believe the build date is when I installed it on this box. When I click on Update Notepad++ it reports that no update is available. It does not list MMBasic in the available languages. Paul in NY |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Latest version is here Ver 7.6.2 - 32 bit BTW I'm using 64 bit but obviously everything is the same. Just out of interest, none of my NP++ versions will bring up a populated function list window, not even with a VB program and language set to VB. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
Paul_L Guru ![]() Joined: 03/03/2016 Location: United StatesPosts: 769 |
Thanks for the link. I'm running a 32 bit but I guess I'll try the 64 bit. Paul in NY |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Installed 7.6.2 but no MMBasic - Mike please can you post your files - would be very useful - thanks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
A couple of people have been trying to get the rough Language Syntax highlighting file running and running into problems. A couple of problems I think I've resolved: First: I don't use the zipped Windows installer version of NP++ as it places files in typical stupid locations. 1: MM_Basic (contained in my userDefineLang.xml) should show up towards the bottom of the Language list after the userDefineLang.xml is placed in the same directory as notepad++.exe. However if you used the Windows installer version then userDefineLang.xml may need to be in C:\Users\your user name\AppData\Roaming\Notepad++\ directory. I simply Download the standalone Zip version, the Zip is placed into a Directory and unzipped, then NP++ it's ready to go, no install or other crap. This makes it easy to save the complete directory and even put it on a a USB stick, it can be run from there or placed into a new directory or another PC and simply work. 2: I use a White background - lot of people use Black or other dark colours: The simple way to try out my colour syntax scheme is to: Goto Settings -> Style Configurator then select Global override, from the list-box labelled Style: In Colour Style box: Set Background colour style to White. Below that Tick Enable Global background colour. In Font Style: Tick Bold, Set Font Name to Courier New, Font size to around 10. Below that Tick: Enable global font Enable global font size Enable global bold font style All other boxes are not ticked. NOTE: If the above does not work then you may need to edit Default Style and change FG colours to Black and BG colour to White. In this case un-tick only the Enable Global background tick box from the above settings. _____________________________________ Once you get it running, you can go into Language-> Define you Language and change all colours, fonts etc. I found that With a black or dark background you are limited in the number of colours that are usable in displaying colour syntax. NOTE: As soon as someone trying this gets it going I'll post the Language file. NOTE 2: I've found a much better way to show Auto Syntax command usage and am just revising the file now, the first one was usable for me but a bit of a crap shoot, mainly due to the constraints placed on the file structure by NP++ I'm making it do something it was not quite really meant to do but it works. Basically the full MM manual description of all MM.Basic commands will be available from within the editor, command selections are shown as you type and selecting a command will show the full command syntax and description in a pop up window. If anyone is interested I'll make that available when I'm happy with it, getting close. Once you have the basic idea you can easily edit that file yourself. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
I downloaded Notepad++ from here: 32 and 64 bit ZIP of Notepad++ Select the one that says "Don't want to use installer? Check this one (zip format)" It's the second on both download lists in both 32-bit x86 and 64-bit x64. I placed the zip file in the root directory of my drive and unzipped it, you can place it in a folder first if needed. When it unzips is creates a directory called npp.7.6.2.bin.x64 (the name of the zip) This has the full ready to go package, just click run notepad++.exe. The default background was already set to WHITE and foreground to BLACK. Below are the screen shots of the ONLY changes I made: Copy the userDefineLang.xml file I will supply into the main directory, that's the same directory as notepad++.exe. Copy the MM_BASIC.xml file I will supply into the sub directory called autoCompletion which was created automatically along with other sub directories when you first unzipped npp.7.6.2.bin.x64.zip. NOTE: I had to reselect MM_BASIC from the Language list twice after changes were made BEFORE the mm.basic file loaded into the editor showed correct Syntax and Auto usage. This shows Syntax highlighting and Functions and Procedures folded: Auto Syntax as I type, I can scroll down the alphabetical sorted list. ![]() Below: I've set the * character to bring up Full Usage syntax for the Commands, This can be changed but there is a reason why I chose to do this, and it all has to do with the constraints imposed by NP++ and the xml file. Showing DAC usage pop up. The pop up is partly transparent but it shows up to a full screen of information and is very easy to read compared to the picture below. ![]() NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
A few thing about Auto Complete and why I used * to highlight command usage. As you type, if the first char you type matches the first char in a keyword in the Auto complete file, then it will open the Auto complete scroll window and the first keyword starting with the char will be shown in an alphabetically sorted list. As you continue to type it's narrowed down, if you press ENTER then the keyword will be inserted into the edit window. Once a keyword is in the editor, if typed it in completely or you pressed enter, then normally you would enter and opening left bracket "(" and this is the default function hint character. Typing this Char causes the command Hint window to open. When you do that the Syntax and information is displayed in another pop up window. The problem is that I want to show the many MM.Basic procedure information, and using the "(" is confusing. The normally selected Function start and close char's "( )" are automatically placed after keyword name and surround the command usage and no way to overcome this, so I chose "*" as the function start and end chars, this makes a world of difference to me anyway and allows me to use the built in Function Hint for every MM.Basic keyword. For some simple functions and procedures there is no need for an extra Hint action or window description as I found a way to include the full command usage after the keyword. In this case, only the Auto complete window is needed and no Hint is made available. Like I said - trying to work within the limitation imposed, I'm getting close to having almost every function, procedure and command word fot the Micromite, MM+ and ARMmite H7 in my auto complete file. The file is simple to edit in Notepad++ itself, so you can simply change it to meet you needs. I'll place a link to them as soon as I'm happy with them, likely in the next week unless someone has already made one and beats me to it. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Well done. I must admit that I gave up trying to get folding working properly in Notepad++ I am looking forward to seeing your work in action. Jim VK7JH MMedit |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1003 |
looks good. I have installed fresh, waiting to see what you have done. Gerry Latest F4 Latest H7 FotS |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
There are two Zipped files, once unzipped: Copy the userDefineLang.xml file into the main directory, that's the same directory as notepad++.exe Copy the MM_BASIC.xml file into the EXISTING sub directory called autoCompletion. Once Again: The Language file is just thrown together, I thought others would have had this sorted already so there will be some missing commands, however this file can be edited from the Language edit screens built into NotePad++ The Colours suit my big screens and me, I find it really clarifies code and mistakes, especially on big code files, you can change them as you wish. The AutoComplete / Code Hints file is a work in progress, see a few post back on how I chose to use it and why. You can change this any way you like. NOTE: If you use an earlier version of Notepad++ OR use the installer for NotePad++ then the directory for Autocomplete will be different, post here if you do and can't find out where the file goes. Again: I had to reselect MM_BASIC from the Language list twice after changes were made BEFORE the mm.basic file loaded into the editor showed correct Syntax OR before Auto usage worked. You know it's working if you type an "a" and the Auto-completion list box opens. Of course you Must have MM_BASIC language selected from the Language menu. Language file AutoComplete file NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Now all I need is someone to actually report that it works for them, even if you don't like the way it looks or the way I've done it. If anyone gets it working and finds it useful in any way whatsoever, then I will keep updating the ZIP files as I add or change things. I'm trying not to spend to much time on this, but as I find a command that's wrong or missing, I just add or correct it while I'm coding in the editor. Note. If you come up with a better way to do this in NP++ or change either file, please share as I'm sure others here would love to try it out, including me. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
Page 1 of 4 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |