Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:19 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Stand-alone MMBasic variable reporter

     Page 1 of 3    
Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:08am 20 Jan 2019
Copy link to clipboard 
Print this post

MMEditPLus is a stand-alone variable report producer.
It will eventually replace the one built-in to MMEdit but for now it can be used with Notepad++

It does differentiate between variables local to functions and should flag any undeclared variables.

To run from Notepad++
Go to Run/Run

Navigate to MMEditPLus.exe and add "$(FULL_CURRENT_PATH)"
after the end of the file name. Include a space and the quotes.

Your shortcuts.xml file should now have an entry similar to:
<Command name="Variable Report" Ctrl="no" Alt="yes" Shift="no" Key="119">C:\apps\PBprojects\variableReport\MMEditPlus.exe & quot;$(FULL_CURRENT_PATH)& quot;</Command>

I had to put a space before 'quot' in the above to stop the forum interpreting it.

I set alt-F8 as the shortcut key.
To send the current file to the variable report,
Save then Alt-F8
MMEditPlus can be open or shutdown. It will replace any existing report with one for the current file.
I haven't found a way to automate the save before run part (yet)

If you drag and drop a filename, drop it in the area above the text frame.
You can drop selected text directly into the text frame and it will be scanned.

With MMEditPlus open, ctrl_A to highlight all the text in Notepad++ or MMEdit and drag it across to MMEditPLus.
This allows you to check code without saving first.

  Quote  main:
INPUT x
PRINT bitreverse(x, 16)
GOTO main

FUNCTION bitreverse(num, k)
LOCAL n
FOR n = 1 TO k
IF (num AND 2^(n-1)) > 0 THEN
bitreverse =bitreverse+
2^(k-n)
ENDIF
NEXT n
END FUNCTION




2019-01-20_120326_MMEditPlus.zip
It is many times faster than the builtin version and does more including sorting.

I deliberately made the exe larger than usual in an attempt to fool the foolish anti-virus program out there. The ones that hate me.

Jim
Edited by TassyJim 2019-01-21
VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 02:18am 20 Jan 2019
Copy link to clipboard 
Print this post

Thanks, I'll give it a try when I'm back at the PC.

Mike
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 02:40am 20 Jan 2019
Copy link to clipboard 
Print this post

Hi Jim

I had to put the MMEditPLus.exe file in the same directory as my *.bas file to get NP++ to run it. (Couldn't find file location)
Am I missing something?

Brian
ChopperP
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:57am 20 Jan 2019
Copy link to clipboard 
Print this post

A quick update.
The original was getting confused between globals and locals

2019-01-20_125634_MMEditPlus.zip

Brian,
I don't know why Notepad++ couldn't find where you put it.
Or was the program opening without any file?

Jim

VK7JH
MMedit
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 03:28am 20 Jan 2019
Copy link to clipboard 
Print this post

Found the problem.

NP++ had quotes in the wrong place . Extra bit needs to go after the quotes around the file path to the MM+ file.

"C:\Program Files (x86)\CCom\MMedit\MMEditPlus.exe" "$(FULL_CURRENT_PATH)"

Brian
ChopperP
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 03:29am 20 Jan 2019
Copy link to clipboard 
Print this post

I noticed a bug in the help file
  Quote  "$(FULL_CURRENT_PATH)"

was missing the '$'
and I think that if you copy and paste out of the PDF you might end up with 'smart' quotes. Not something we want.

Brian,
by putting the exe in with MMEdit, the .inf file should be in the MMEdit data folder
eg
C:\Users\Jim\AppData\Local\CCom\MMedit\MMEditPlus.inf
That's where it will end up eventually.
JimEdited by TassyJim 2019-01-21
VK7JH
MMedit
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 05:05am 20 Jan 2019
Copy link to clipboard 
Print this post

Thanks Jim.

Found the inf file with the mmedit one.

Noticed that the subroutines come up as "Fn" in the "Type" column in the program I'm testing at the moment

Brian
ChopperP
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1003
Posted: 05:41am 20 Jan 2019
Copy link to clipboard 
Print this post

Hi Jim,
Looks good.
A minor issue easily worked around , the variables M1H,M1L,M2H and M2L in the expression below are not picked up as declared.Could be because of the assignment before them.



  Quote   DIM FLOAT M1=(R1+R2)/R2,M1H,M1L,M2H,M2L


Regards
Gerry
Latest F4 Latest H7 FotS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:43am 20 Jan 2019
Copy link to clipboard 
Print this post

  Chopperp said  
Noticed that the subroutines come up as "Fn" in the "Type" column in the program I'm testing at the moment

I didn't differentiate between subs and functions.
I also didn't differentiate between const and dim.
For the exercise of tracking variables, the differences don't matter.

Jim



VK7JH
MMedit
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 05:47am 20 Jan 2019
Copy link to clipboard 
Print this post

Thanks Jim


ChopperP
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 05:59am 20 Jan 2019
Copy link to clipboard 
Print this post

Just tried it, ran first time.

As I'm running NP++ standalone version, I placed the file in a subdirectory in NP++.

FYI I had my 3700 line file still loaded in the editor, pressed my shortcut key and up popped the MMEditPlus window.

After a few seconds got a message that MMEditPlus.exe had stopped responding - I new it hadn't, just waited a few seconds more and the results then came up, nice.

Thanks for the standalone app.

Mike

Edited by KeepIS 2019-01-21
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 06:26am 20 Jan 2019
Copy link to clipboard 
Print this post

Did find one thing, the line below is in SUB OpenJOBS()"


Open "JOBS.TXT" For RANDOM AS #3


In the Listing:

OpenJOBS \ RANDOM *** 2945

EDIT same for OUTPUT:


Open "SETTINGS.TXT" For OUTPUT AS #2


SaveSetup \ OUTPUT *** 2827

I assume it thinks these are not declared.

Mike.
Edited by KeepIS 2019-01-21
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:34am 20 Jan 2019
Copy link to clipboard 
Print this post

I missed RANDOM from the keyword list.
Will fix.
Thanks

I also had a bug when there are 2 spaces between FUNCTION and the name of the function.
That will also be fixed in the next update.

I have a few ideas to speed up the processing but it needs careful thought.
Time to open a bottle of thought juice.

Jim

2019-01-20_165921_MMEditPlus.zip
Double spacing shouldn't cause problems and RANDOM has been added as a keyword.
Edited by TassyJim 2019-01-21
VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:51am 21 Jan 2019
Copy link to clipboard 
Print this post

A speed improvement. Time down to 50% of previous version.
It takes about 1mS per line.
2019-01-21_155040_MMEditPlus.zip

Jim
VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 06:00am 21 Jan 2019
Copy link to clipboard 
Print this post

Thanks, that made a big improvement in time, and no messages from Win about responding with a big file loaded. (because it took longer that Win-10 thinks it should).

Mike.


NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:43am 21 Jan 2019
Copy link to clipboard 
Print this post

I should learn multi-threading so Windows doesn't get so upset.
I could put a progress report in half way but too much of that only slows things down again.

Jim

VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:56am 24 Jan 2019
Copy link to clipboard 
Print this post

A few more time saving changes.
Time taken is down by 25% compared to the last version I posted.
2000 lines takes about 1.5 seconds.

I have also added the list of long lines.
2019-01-24_165443_MMEditPlus.zip

Jim



VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 01:06am 25 Jan 2019
Copy link to clipboard 
Print this post

Just got back and tried it and it's faster again

BTW: It flags "OUTPUT" *** :

Open "SETTINGS.TXT" For OUTPUT AS #2

Mike.


NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 01:31am 25 Jan 2019
Copy link to clipboard 
Print this post

Thanks,
OUTPUT has now been added to the keyword list.
2019-01-25_113018_MMEditPlus.zip

Jim
VK7JH
MMedit
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 01:03pm 25 Jan 2019
Copy link to clipboard 
Print this post

Jim,
MMEdit (V3.8.0. Build Date 18/11/18) seems to be missing the STATIC command too. I'm using it with the 'MicroMite_Plus_V5.3' syntax file and MMBasic V5.05.01. It misses it using command 'STATIC INTEGER variable' - the 'STATIC" part isn't made upper case or highlighted.
Not sure if you might have already picked it up.

Greg
 
     Page 1 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025