![]() |
Forum Index : Microcontroller and PC projects : Stand-alone MMBasic variable reporter
![]() ![]() |
|||||
Author | Message | ||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Did you edit the inf file to point to your MMEditPlus.exe ? and have you updated the exe to the latest one? Can you send me a copy of your code that fails to format fully. The format code in the plugin has a few shortcomings. I can improve it a bit but I need samples of other coding styles to sort it out. Jim VK7JH MMedit |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Yes and yes - However! I rechecked the path again. My original path entry - D:\Programming\NOTEPAD++\MM_VAR_Usage\MMEditPlus.exe Corrected - D:\Programming\NOTEPAD ++\MM_VAR_Usage\MMEditPlus.exe So plugin working. I'll narrow down the formatting first and post something smaller that does not format correctly. The formatting is perfect in MMEdit, but in NP++ after using the MM plugin format, towards the end of the code, all code sits against the left margin and does not indent - I only had a quick look so I'll get something that will show it up. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Try this one. I changed a few things and have worked out a way of testing the function with the debugger on. Difficult when it is a DLL! 64Bit version: 2019-02-07_162515_nppMM64.zip I have also added an 'about' box with the path to the exe shown to make it easier to check when things don't work. This is the 32bit version: 2019-02-07_162851_nppMMplugin.zip Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Mike, Currently, if there is a formatting error (either end-user or my program), the rest of the code is usually stuck unformatted. I am considering changing it so that each SUB/FUNCTION starts again so that only the faulty SUB looses formatting. As it stands, I go to the end of my program and if the formatting at the end looks good, I assume that the full program is OK. I would loose that ability and would have to check each SUB for errors. Not sure which way to go. I will also add the option to highlight a section of code and only format the selection. If nothing is selected, the full program gets the treatment. Jim VK7JH MMedit |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Thanks Jim, I just got back at the computer and found your reply and new download. Success ![]() It was falling over at around line 2800. After that it was as though it just stopped formatting or was only partly formatting in some cases. It had nothing to do with the code as cutting out previously formatted code and pasting at the same position made no difference, it would still no longer format that code correctly after roughly 2800 lines of code. Now all is good for just over 4000 lines of code, great job and a really great addition. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
I'd lean towards leaving it as is, the ability to go to the end and check formatting is something I also do all the time. The option to highlight select might be handy when just adding or modifying a section of code and not having to worry about upsetting current full file formatting. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Progress (I hope) You can now select a portion of code to format. It does strange things if you start a selection part-way through a FUNCTION. If your selection covers part of a line, the whole line is included. There is also a message box which announces the name of the FUNCTION where the first formatting error is found. If you don't want the error, add the following to your inf file: Suppress format error = 1 32bit version 2019-02-08_133624_nppMMplugin.zip 64bit version 2019-02-08_133647_nppMM64.zip Jim VK7JH MMedit |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Really nice, a quick test of highlight formatting worked perfectly, great addition. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Just a bit of info for what it's worth - or not. I tried a few other test files with formatting, I found this part in an old test button file that bought your Error Box up and pointing at SUB PenDown() SUB PenDown() CTRLVAL(DsplyBOX_MM) = "--" SELECT CASE TOUCH(REF) CASE B_JOBS CTRLVAL(NewHeightPOS) = "JOB" CASE B_GO CTRLVAL(NewHeightPOS) = "GO" CASE B_STOP CTRLVAL(NewHeightPOS) = "STP" CASE ZERO_H CTRLVAL(NewHeightPOS) = "Z_H" CASE HOME_H CTRLVAL(NewHeightPOS) = "HM_H" CASE BIT CTRLVAL(NewHeightPOS) = "BIT" CASE HOME_F CTRLVAL(NewHeightPOS) = "HM_F" CASE ZERO_F CTRLVAL(NewHeightPOS) = "Z_F" CASE MM_IN CTRLVAL(DsplyBOX_MM) = "MM" CASE FenceKpad CTRLVAL(NewHeightPOS) = "FkP" CASE HeightKpad CTRLVAL(NewHeightPOS) = "HkP" CASE B_SETUP Pin(46)= 0 Pin(137) = 0 Pin(75) = 0 CLS Print "TOUCH EXIT" END CASE ELSE CTRLVAL(DsplyBOX_MM) = "ELSE" END SELECT END SUB It spits the dummy at the END statement in CASE B_SETUP, like I said just a quickly thrown together test and using END to drop to the Prompt when the Setup button is pressed. It places the end keyword against the left margin, however If I indent the END statement a few tabs then it ignores it as an error but formats it off line. Further down in the code is this SUB, it doesn't complain at all and leaves END against the left margin: I removed the first END above and still no complaint about the second, obviously being in a select case statement with an end select expected may have something to do with the first one? [code] SUB EXITINT() Pin(46)= 0 Pin(137) = 0 Pin(75) = 0 CLS Print "INT EXIT" END END SUB [/code] Nothing to really worry about at all but thought it might be of interest. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
My code looks for the indent level when an end is detected. It checks to see if there is an 'if' or 'select' following but I didn't allow for nothing following. Easy enough to fix. In your first sub, the indent is one level in compared to the start when the END is reached. This causes the warning. In your second SUB, the indent level matches the start so no warning. Thanks for testing. Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
This should have it working better: 32bit code 2019-02-08_170734_nppMMplugin.zip 64bit code 2019-02-08_170747_nppMM64.zip Jim VK7JH MMedit |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1882 |
Thanks, all good now. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |