Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 12:11 20 May 2024 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 : MM Edit V3.4.11

     Page 2 of 2    
Author Message
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 09:30am 02 Jun 2014
Copy link to clipboard 
Print this post

  Quote  One disadvantage with this method is when you program exits with an error. The line number reported will not be the same as the line number in the editor.


Hi Jim

Having used Auto Crunch now for a day, preserving Line numbers is essential ! Finding the offending line from an error back in the source in MMEdit is nigh impossible after Auto Crunch. So what I would suggest is that All Comment text is removed, but the line itself is kept,ie blank with just the line ending. Also all blank lines should be trimmed of any white space, and just the line-endings kept.

More involved perhaps, but could maybe remove all unnecessary white space,
eg A = B + C, could be crunched to A=B+C.

Many thanks

Peter


The only Konstant is Change
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 11:53pm 02 Jun 2014
Copy link to clipboard 
Print this post

@psergiu
Thank you for the very complete information, it helped a lot.
I think I have found the problem and the attached ZIP hopefully works for you.

@G8JCF
The new ZIP has another option in preferences "Delete blank lines"
With it set, the Crunch works as before. With it unset, I think you will be pleased.
Let me know what file sizes you end up with.
I have avoided removing spaces within the line as it is a lot more involved.
The MM Basic Crunch program does do it (and more).

@Mick
Now that I have better Icons available (used in MMEdit2), I can change the ones in MMEdit V1 as well.
It will have to wait until the current bugs are squashed.

2014-06-03_095133_MMedit.zip

Jim

VK7JH
MMedit   MMBasic Help
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 03:58am 03 Jun 2014
Copy link to clipboard 
Print this post

Hi Jim

Spot on !!! Superb, uMite source line numbers line up with MMEdit source line numbers.

No Auto Crunch 18,338 Bytes - 831 Lines
Auto Crunch Only 9,412 Bytes - 831 Lines
AutoCrunch+Delete Blank Lines 7,768 Bytes - 420 Lines

What an improvement in code size your AutoCrunch feature offers, and encourages good practice to create understandable and maintainable code.

Perhaps MMEdit V2 could go that extra couple of steps re white space, intellisense :) ?

Now have you considered pragmas ?

In Particular a #Debug pragma ?

eg

#Debug
Code inside here only gets sent to the target if #Debug pragma is set on in Preferences

#End Debug

Reason for suggestion is that because one can't set breakpoints in MMBasic (afaik), I tend to have to insert a lot of print statements and then have to keep commenting them out/removing comments as required.

In addition, a Block Comment/Uncomment menu under Edit would be really nice.

I don't know what MMEdit is programmed in, but whatever it is, it and you are impressively fast.

Apologies if I'm coming across as a bit cheeky asking for these enhancements.

Thank you !

Peter - GM8JCF


The only Konstant is Change
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 04:02am 03 Jun 2014
Copy link to clipboard 
Print this post

Hi Jim

PS, AutoCrunch also really reduces download time improving programmer productivity.
The only Konstant is Change
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 01:50pm 03 Jun 2014
Copy link to clipboard 
Print this post

  G8JCF said   Hi Jim

Spot on !!! Superb, uMite source line numbers line up with MMEdit source line numbers.

No Auto Crunch 18,338 Bytes - 831 Lines
Auto Crunch Only 9,412 Bytes - 831 Lines
AutoCrunch+Delete Blank Lines 7,768 Bytes - 420 Lines

What an improvement in code size your AutoCrunch feature offers, and encourages good practice to create understandable and maintainable code.

That's a good outcome.

  G8JCF said  
Now have you considered pragmas ?

In Particular a #Debug pragma ?

Doing that will upset the line numbering again.

  G8JCF said  
In addition, a Block Comment/Uncomment menu under Edit would be really nice.


MMEDit2 already has an option to comment / uncomment blocks of code. It should be relatively easy to add to the current code.

Jim

VK7JH
MMedit   MMBasic Help
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 02:08pm 03 Jun 2014
Copy link to clipboard 
Print this post

Hi Jim

Regarding #DEBUG PRAGMA <....> #END DEBUG

Why not use the same strategy as for comments, (in auto crunch) ie blank lines when debug code is NOT downloaded ?

Block Comment/Uncomment would be really great !

Now how about a Breakpoint function ?

I have found that typing ':Error "BREAK"' on the end of a line causes MMBasic to break on that line, and then "CONTINUE" (as a macro in MMEdit) continues execution. So what I envisage is that double clicking on a line toggles ON/OFF a breakpoint which actually cause MMEdit to append ':Error "BREAK"' to the line. Then also a menu item to "Clear all Breakpoints" which removes all such appended ':Error "BREAK"' statements.

Anyway, I've used the new Auto-Crunch mode all day today, and it works great, I have it set ON all the time. I get compact code on the uMite, with full source in MMEdit. Auto-Crunch is just the bee's knees :)

Also I read your manual very carefully and discovered that MMEdit is written in Liberty Basic, so I went and got a copy to see for myself what it's all about. I've always been a Microsoft Visual Basic user since V1 and a lot of what I'm asking from MMEdit is what I get from VB6+MZEdit - is that good or bad :)

Take care, & thank you

Peter - G8JCF

PS. Did you get that Beer ?


The only Konstant is Change
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 02:21pm 03 Jun 2014
Copy link to clipboard 
Print this post

Peter,
Liberty Basic is fairly easy for an old programmer to get used to.
The fact that there are no 'types' to worry about and numbers are all unlimited precision, makes life easy.

MMEDit2 is being written in PureBasic so I have to get used to all the number 'types'.

I am changing languages so that I can produce for Linux as well as Windows. If I could afford a Mac, I could also produce for them.

If we ask Geoff nicely, we might get a DEBUG command which acts like
IF DEBUG then PRINT....

The man in the white coat would frown on me having a beer just now but ebay has had plenty of other distractions.

Jim
VK7JH
MMedit   MMBasic Help
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 02:29pm 03 Jun 2014
Copy link to clipboard 
Print this post

PureBasic ???? Right I'll have to go have a look at that now !!

Personally I favour strongly typed languages, although PERL is my favourite scripting language.

My Brother lives in Perth and he says "Whatever happens, Drink Beer !"

But if the Dr. says NO, then perhaps "Drink Koala Cola" might be more wise, but then again the Dentist might have other thoughts.

BTW, have you received my emails with the AD9850 Controller source code ?

And to finish, I can't thank you enough for Auto-Crunch, it just works !!

Stay well

Peter
The only Konstant is Change
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 06:04pm 03 Jun 2014
Copy link to clipboard 
Print this post

Peter,
I have received your emails OK but have not had time to look at the code yet.

My protect for the AD9850 was going to start with a VFO. I do a sweep generator on my spectrum analyzer but another one that can be PC controlled would be handy.

I have been thinking about the DEBUG code.

If we end the DEBUG lines with a comment
for n = 1 to 5 'DEBUG
print stuff(n) 'DEBUG
next n 'DEBUG


It would be easy to convert those lines to a comment (and back again) for the full program.
'for n = 1 to 5 'DEBUG
'print stuff(n) 'DEBUG
'next n 'DEBUG

The process would be something like:
Highlight the lines,
MMEdit adds the 'DEBUG
option to convert all (or selected) to comments and back again
You then have the option to crunch....

This wouldn't break any existing code and saves on typing etc.

Jim
VK7JH
MMedit   MMBasic Help
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 04:39am 04 Jun 2014
Copy link to clipboard 
Print this post

Hi Jim

I understand, and yes that would indeed work. So just to repeat steps for my clarity.


Highlight/Select a set of line(s)
Click Toggle Debug button
MMEDIT appends 'Debug to the selected lines.

If Line(s) already end with 'Debug, then remove 'Debug

To run with Debug OFF
Click Load NoDebug
MMedit scans source and prepends ' to every line which ends with 'Debug
Downloads code

To run with Debug ON
Click Load Debug
MMEdit scans source and removes leading ' from every line which ends with 'Debug
Downloads code

Is my understanding correct ?

Very many thanks

Peter
The only Konstant is Change
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 12:49pm 04 Jun 2014
Copy link to clipboard 
Print this post

Very close Peter.
I spent a bit of time playing around with various options yesterday and there is a bit more playing to do.

The first stage will not be a toggle.

Highlight/Select a set of line(s)
Click Mark Debug button
MMEDIT appends 'Debug to the selected lines.

or
Click Remove Debug button
remove 'Debug

Lines which are already a comment for the full line are left alone.
If there is a comment starting at the end of the line, the Debug options work as normal.

You can then 'select all' and 'Mark DEBUG as comment'
MMedit scans source and prepends ' to every line which ends with 'Debug




There will be something to play with later.

Jim
VK7JH
MMedit   MMBasic Help
 
psergiu

Regular Member

Joined: 09/02/2013
Location: United States
Posts: 83
Posted: 06:03pm 04 Jun 2014
Copy link to clipboard 
Print this post

Tried the latest MMEdit update, much better, still some bugs:

- The "Load and Run" button now works okay the 2nd time (and all successive times)
- While the "File Master" window is open, the "Load and Run" button does not work (V0.0 issue)
- After the "File Master" window is closed, pushing the "Load and Run" button will detect the version correctly, will upload the file correctly and:
- - If "Auto run on load" is not selected, it will LOAD "temp.bas" correctly
- - If "Auto run on load" is selected, it will just sent a empty line to the Maximite instead of the RUN command.

 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024