Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:38 27 Nov 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 : New version of MMBasic (ver 4.3)

     Page 2 of 3    
Author Message
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 02:22pm 23 Jan 2013
Copy link to clipboard 
Print this post

There are only 3 instances where RENUMBER is useful.

1) Tidying up my program listings so that the numbers flowed sequentialy in even increments.

2) When one needs to insert more lines of code within a program and needs to create space between two existing line numbers.

3) Typing in or running some old program that was written with line numbers.

That's it.

All programming on the MM is otherwise done with no line numbers and does not need RENUMBER.

Personally, I don't care if it is removed or not. If I don't need it, I don't use it. Someone else may find it useful or need it for some task (convert old software) so it would be useful for their purposes.

That's the beauty of MMBASIC... it's flexible.

Nick

 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 02:56pm 23 Jan 2013
Copy link to clipboard 
Print this post

  Geoffg said   But ratall's main point was that the renumber command could go, and I believe that he has a good point. Would anyone mourn its passing?


I for one would mourn it, but I fear I am in the minority here...

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
boss

Senior Member

Joined: 19/08/2011
Location: Canada
Posts: 268
Posted: 03:58pm 23 Jan 2013
Copy link to clipboard 
Print this post

Hi,

I remember these early 80's days when we had a Wang computer in our lab, we wrote programs in unique BASIC dialect and the RENUMBER command totaly screwed our work many times.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 04:27pm 23 Jan 2013
Copy link to clipboard 
Print this post

Wouldn't worry me - but unless people are running into memory problems routinely that can be fixed by removing it, why bother? Geoff has the best handle on when he needs to free up some memory - I'd leave that entirely to him.
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 05:29pm 23 Jan 2013
Copy link to clipboard 
Print this post

An alternative:

Use the Renumber.bas program that Geoff wrote for the original library to renumber the code. I recall someone mentioned it had dropped out of the latest library, but if it could be updated with all the new keywords there would be little need to keep the function as part of the editor.

It remember that program as an example of really tidy coding. It should be easy to update.

James
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 06:46pm 23 Jan 2013
Copy link to clipboard 
Print this post

I'm confused.

Is the RENUMBER function causing problems?

Nick
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 07:50pm 23 Jan 2013
Copy link to clipboard 
Print this post

  Nick said   I'm confused.

Is the RENUMBER function causing problems?

Nick


Not that I know of. It's more a question of whether it's still used. The question was raised by Ratall

  Ratall said  
Hi Geoff
Great work as usual.

Just wondering given that line numbers are no longer required and the ever increasing demand on memory with all the new features, do you not think it may be time to remove the embedded renumber command.
I'm am sure an external basic ultility will do for the few people who still use line numbers.
I do not know how much it will save but I had a quick look at the c code and it does seem quite substantual.(but I am no c or pic expert)
Equally having a Full screen embedded editor is nice when debugging ** but is it the best use of memory.
I know it is getting away from the original idea of a 1980s style computer but I think its already evolving away from that.

Maybe I am alone it these thoughts. It would be interesting, I think to find out what people use and what they will never use.

Thanks again Geoff

R.

My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
boss

Senior Member

Joined: 19/08/2011
Location: Canada
Posts: 268
Posted: 07:51pm 23 Jan 2013
Copy link to clipboard 
Print this post

Hi Nick,

yes, here is one example I can recall from my memory, to be situation even more precarious the errors appeared pure randomly, so you renumbered programm succesfuly 10 times and the this appeared:

Before After
100 rem 100 rem
111 ..... 110 ......
222 ..... 120.......
333 ..... 130.......
444 GOSUB 3333 140 GOSUB 3333
.
.
.
END
3333 rem subroutine 500 rem subroutine

 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 08:19pm 23 Jan 2013
Copy link to clipboard 
Print this post

I recall in an earlier version of MMBASIC (before the ability to have no line numbers), RENUMBER had a bug that I mentioned to Geoff who, as always, promptly fixed and I was able to renumber my program with a nice and tidy line increment of 10.

It worked fine for me thereafter.

Now, I don't need it at all but it doesn't bother me that it's still there.

You never know, I may one day want to type in the Star Trek game as listed in the well known book by David H Ahl's "Basic Computer Games".

What's a computer without a classic Star Trek game!!



 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 08:21pm 23 Jan 2013
Copy link to clipboard 
Print this post

Nick If you rewrite it, I will play it Edited by djuqa 2013-01-25
VK4MU MicroController Units

 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 09:01pm 23 Jan 2013
Copy link to clipboard 
Print this post

  James_From_Canb said   I recall someone mentioned it had dropped out of the latest library, but if it could be updated with all the new keywords there would be little need to keep the function as part of the editor.

It remember that program as an example of really tidy coding. It should be easy to update.

James


Yes, Renumber.bas was removed from the User Program Library as it was out of date. If anyone wants to have a go at bringing it up to date, I can send you a copy. Just PM me with your email address.
Cheers,
Hugh
 
ratall
Newbie

Joined: 27/11/2012
Location: Australia
Posts: 12
Posted: 09:29pm 23 Jan 2013
Copy link to clipboard 
Print this post

HI All
I made the post about the renumber and edit to start a conversation.

So here I will clarify.

I noticed that Geoff is constantly adding to the functionallity of the Maximite.(and doing a great job)but everything has a cost. I also know it is human nature to hang on to things you are familiar with often long after they have stop being usefull.

If Geoff knows what people value and what they do not. When the time inevitable comes when he has to make the choice between adding a wanted feature and sacrificing a current feature or not adding that feature at all, knowing what people value will make the choice easier.

My main point with the renumber is its fairly large piece of code that could be easly handle by a utility written in BASIC. (interestingly writing such a utilitly used to be a fairly standard piece of coursework for students at one time ).

Suggesting the Full screen edit "may not be the best use of memory" I thought would get conversation moving better than just talking about the renumber.

If you look at the device as a stand alone computer the full screen editor is great. If you look at it as a quick and easy way to delevelop home projects that interfave with the real world you may feel a libary of device handlers is a better use of memory than a full screen editor. If you use it as an educational device you probably want a bit of everything.

(the next 2 paragraphs are just me showing my age, skip them if you want they are not that relevant)

When I started out in working in computing we used paper tape. The big advance of the time was punched cards. Many of the more experinced programmers refused point blank to use them saying it was too easy to shuffle(quite literally) for one thing and there were too many holes making them hard to read etc etc. Sequence numbers (line numbers) on the cards were essential, but editing was a breese remove a card re-punch and insert in the right place, paper tape not so easy.

For many years after paper-tape went out of favour there were computers that would not boot with out a papertape reader attached. Why? becuase the companies spent a lot off time hardcoding the paper-tape reader in (prior to that you enter the bootstrap papertape reader code via switches) and knowbody told them that the only thing read off of paper-tape was the card reader driver. Also I suspect,people did not want to lose something they lobbied so hard to get just because they didn't use it anymore.


Somebody suggested not removing code because controllers are getting bigger/faster and cheaper all the time. This approach leads to big ugly impossible to maintain code. Double the code size, quadruple the potental for errors(just look at Windows). Also Geoff is not Microsoft he doesn't have hundreds of people sitting around to maintian code almost nobody uses.

When I asked Geoff about making interupts persistant over chains he quite rightly pointed out very few people would require it and it just was not worth it.
That got me thinking about what was already there.
If it's not used I presonally think it should go' particularly if there is a viable alternate like renumber.bas.

I like the Maximite its fun. Lets keep it fun for Geoff too, don't make him maintain code nobody uses, give him room to move. Tell him know what you use and what you don't. not just what you want.

So in that vane. I think I will put another couple of question out there. Just for fun.

If you could have any feature added to the maximite but you had to loss some other features in order to get it.

What would want and why?

and of course

What would you be willing to lose to get it?

and just so Geoff doesn't get depressed

What do you think is the best feature of the maximite and why?



R.


  Nick said  

Full screen editor getting away from the original 80's style computer??!

Nick

Nick I am afraid you miss read me. What I was saying was removing the full screen edit would be getting away from 80s style computers. Just wanted to clarify some times I am not as clear as I would like to be.

 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 11:11pm 23 Jan 2013
Copy link to clipboard 
Print this post

If Geoff has run out of space to add to MMBASIC and needs to recover some memory then yes, RENUMBER could go.

If there isn't a problem, why touch it? I'm sure Geoff has better things to do.

Personally, I think we should give Geoff a break. He's spent a lot of time providing us with the Maximite and MMBASIC, added and expanded it as per our wishes.

It's time we stopped asking for more and start using what's been given to us. MMBASIC is quite powerful now.

Let's go forth and create applications to make our Maximite useful, productive, educational and fun.

NickEdited by Nick 2013-01-25
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9307
Posted: 11:09am 24 Jan 2013
Copy link to clipboard 
Print this post

ratall makes good points.
nick makes equally good points.

Having read ratall's post, and was going to start posting what I would like to see in the MM at the expense of other functions etc, then I read nick's post right below it, and it put things in perspective.

nick is right IMHO, and certainly no disrespect to ratall for his comments.

I have often thought to myself since the original MM was published in SC, what a great toy this thing is, and was amazed at what it could do even in B/W. I often wondered how many thousands of lines of code Geoff had written to create the MMBASIC firmware - I speculate it was quite a few... Unfortunately at the time, it lacked serial IO, decent sound and colour video.

Then along came the colour MM which fixed the colour and decent sound wishes.
Actually, the serial IO was fixed in a firmware update for the original MM.

Once those three things were satisfied, I just HAD to play around with it seriously, as I was up till that time, using PICAXE and several external modules to do the same thing that the MM does all in one package. No disrespect to the PICAXE - I still use these too, but for more advanced projects where you need sound and video, the MM wins hands down now, especially as it is now in colour.Edited by Grogster 2013-01-25
Smoke makes things work. When the smoke gets out, it stops!
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 12:54pm 24 Jan 2013
Copy link to clipboard 
Print this post

I agree with ratall and nick and as far as I am concerned, Renumber can go but please keep the Editor as I use it all of the time. James-from Canb is going to have a go at bringing RENUMBER.BAS up to date for those who still like to use numbered lines. Personally, I cannot abide them, but it takes all kinds to make a world.

A huge thanks to Geoff for the Maximite in all its incarnations. May he rest upon his laurels for a while. He deserves it.

Cheers,
Hugh
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 01:33pm 24 Jan 2013
Copy link to clipboard 
Print this post

I agree with the replies above.

No disrespect to ratall at all.

We have a lot of talented people here each from different programming backgrounds. Geoff has done an amazing job to accommodate everyone and we need to respect the fact that what seems worthless to one person is a needed feature for another.

Anyone who has looked at my code in "Donut Dilemma" will see that I'm from the old-school world of BASIC programming. Yet, I have now embraced no line numbers, I'm starting to use Do-while loops and I'm using less heavily condensed multi-statement lines.

The point is, I could still do everything the "old way", it didn't prevent me from achieving what I needed to do. At the same time, I'm learning to embrace the modern way of coding. MMBASIC supports both these programming styles and that's a credit to Geoff.

I, as someone who has written 2 of the largest programs for the Maximite to date (correct me if I'm wrong), I haven't really encountered memory limitations.

I did in MaxMan for awhile so I asked Geoff to include the command LOADBMP. Donut Dilemma uses this command to achieve a game with 10 different levels, title pages and high score pages with colour graphics and yet it has plenty of spare RAM left over to include at least another 10 levels.

www.maximite.net.au

Nick





Edited by Nick 2013-01-25
 
ratall
Newbie

Joined: 27/11/2012
Location: Australia
Posts: 12
Posted: 10:45pm 27 Jan 2013
Copy link to clipboard 
Print this post

Hi Geoff
Sorry to bug you.
But I think I've found a small bug


t$ = Left$(Mid$(ProgLine$,10),instr(ProgLine$,"("))


causes an error

Error: Expected closing bracket



t$ = Left$(Mid$(ProgLine$,10),instr(ProgLine$,")"))


causes an error

Error: Invalid syntax


these however are excepted with out error


t$ = Left$(Mid$(ProgLine$,10),instr(ProgLine$,Char$(40)))

t$ = Left$(Mid$(ProgLine$,10),instr(ProgLine$,Char$(41)))

t$ = Left$(Mid$(ProgLine$,10),instr(ProgLine$," "))


and so most interestingly is this


t$ = Left$(Mid$(ProgLine$,10),instr(ProgLine$,"(")))



It looks like the interperter is counting the braces in the string or I can't count (very possible)

There is a simple work round so its not urgent. but it is confusing if you don't spot it.

thanks
R. Edited by ratall 2013-01-29
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 08:24pm 29 Jan 2013
Copy link to clipboard 
Print this post

  shoebuckle said   James-from Canb is going to have a go at bringing RENUMBER.BAS up to date for those who still like to use numbered lines.

Cheers,
Hugh


I've rewritten RENUMBER.BAS so:
. it is less like assembler and more like structured Basic.
. it is case insensitive. It doesn't matter if you write GOTO or GoTo or goto.
. it handles programs that have a mix of lines with and without line numbers.
. it aligns the start of the code to the longest linenumber. Now your code all starts on the same column - no more dogleg between lines 90 and 100.
. it ignores line numbers in comments. ** (see note below about single quotes)
. it is based on the structure of lines - it recognises multiple statements separated by colons, and comments.
. it checks that line numbers are all in order, and there are no duplicates.
. it warns if it finds any occurences of "rem " which the program uses as a flag that the following text is a remark.

It's not perfect yet. It probably never will be. For example, I can see a problem if a line like
10 IF X$ = "'" THEN GOTO 200
exists, because everything after the single quote will be processed as a remark, and the GOTO 200 will not be updated correctly.
Also, I haven't implemented the code for a Start line in the input file yet, so it isn't a replacement for the current internal MMBasic operation yet.

However, it's getting close. Would anyone like to test the code and let me know if they find any problems or have any suggestions?

Standard warning though: If you test it using a program that's important to you, back up your program first, and don't let my program anywhere near the backup!

2013-01-30_061412_RENUMBER.zip

James

My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 08:52pm 29 Jan 2013
Copy link to clipboard 
Print this post

Hi James,

I wonder, can it handle e.g.

print "goto" etc?

will the "goto/gosub" be recognised as an occurrence of goto/gosub?
David M.
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 09:07pm 29 Jan 2013
Copy link to clipboard 
Print this post

David,

Print "Goto 100" will have problems. Good pickup. Thanks.

Maybe I can treat text within double quotes like a remark - trim it out while I process everything else, then put it back together again. I'll think about it.

James
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
     Page 2 of 3    
Print this page
© JAQ Software 2024