Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:15 24 Sep 2020 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 : Hope for MMBasic DOS update?

Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 883
Posted: 01:27pm 01 Aug 2020
Copy link to clipboard 
Print this post

Now that MMBasic for the CMM2 is locked except for fixes (kudos all around), will there be some plan for updating the DOS version?

In particular, I'd like to see support for long strings (which I have working thanks to code and compilation pointers which Peter provided), FIELD$, and JSON$ (from the pi-cromite and eXtreme).

Graphics as per MM2, etc. (or other as suitable), would be a long-shot wish.
 
mclout999
Senior Member

Joined: 05/07/2020
Location: United States
Posts: 104
Posted: 02:55pm 01 Aug 2020
Copy link to clipboard 
Print this post

I for one would love to have graphics and sound so we can prototype on the PC.  Also I love MMbasic and would like use it on Windows to pay gams from the CMM2.  I would also like to see it be able to package an self contained executable like BBC basic and other so we can share our games with others on PCs.
 
hitsware2

Senior Member

Joined: 03/08/2019
Location: United States
Posts: 219
Posted: 03:19pm 01 Aug 2020
Copy link to clipboard 
Print this post

  mclout999 said   BBC basic


Yes ! .... Kudos to R . T . Russell
http://www.hitswares.com/
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 2743
Posted: 01:26pm 02 Aug 2020
Copy link to clipboard 
Print this post

Support for long strings, FIELD$, and JSON$ should be easy and I will look into it.  Other stuff from the CMM2 such as the MATH command could also make it.

Graphics and sound will be very difficult.  I will re look at that but I doubt it.

It would be wonderful to emulate the CMM2 and/or Micromite in the Windows/DOS version but it is never going to happen - the platforms and environments are just too different.

A self contained executable would be wonderful... needs some thought.

Geoff
Geoff Graham - http://geoffg.net
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 883
Posted: 04:25pm 02 Aug 2020
Copy link to clipboard 
Print this post

  Geoffg said  Support for long strings, FIELD$, and JSON$ should be easy and I will look into it.

Thanks. And also FORMAT$ if possible.
 
IanT
Newbie

Joined: 29/11/2016
Location: United Kingdom
Posts: 34
Posted: 08:48am 03 Aug 2020
Copy link to clipboard 
Print this post

  Geoffg said  Support for long strings, FIELD$, and JSON$ should be easy and I will look into it.  Other stuff from the CMM2 such as the MATH command could also make it.

Graphics and sound will be very difficult.  I will re look at that but I doubt it.

It would be wonderful to emulate the CMM2 and/or Micromite in the Windows/DOS version but it is never going to happen - the platforms and environments are just too different.

A self contained executable would be wonderful... needs some thought.

Geoff


It would be very nice to see the "DOS" MMB getting some updates Geoff, if only to keep it generally in-line with the other large platform MMB family versions that have the space for more features. Perhaps we could also start calling it "PC-MMB", which might encourage more folk to try it out and find good uses for it.

I find PC-MMB very convenient to write and test (I'm still learning) small snippets of 'logic' that may end up in my Mite programmes when (if) I've figured out how best to do things. I also have some useful (to me) standalone programmes that don't need any graphics or sound but which simply just compute things and provide results.

BTW - If I was a good bit cleverer and a lot more confident, I'd write a programme to read in and write out CSV files, so I can move data between Excel and PC-MMB. If anyone has done this already, I'd appreciate a copy.

So, just to thank everyone here again for all their efforts in developing & supporting these great MMB tools which are so very useful to me and (I'm sure) many others quietly watching and learning.

Regards,

IanT
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 405
Posted: 09:21am 03 Aug 2020
Copy link to clipboard 
Print this post

Hi IanT,

It is very simple to create csv files from MMbasic for DOS.
You have to write data in readable ASCII form, with comma's in between.

Example
Open "test.csv" For output As #1

a = 123
b = 124
c = 127
d = 140

Print #1, Str$(a);",";Str$(b);",";Str$(c);",";Str$(d)

Close #1

End


In Windows you will see a file named "test.csv" appear.

Clicking on it will open Excel




If you want the data in different rows, you have to use different print statements

Open "test.csv" For output As #1

a = 123
b = 124
c = 127
d = 140

Print #1, Str$(a);",";Str$(b)
Print #1, Str$(c);",";Str$(d)

Close #1

End


The file opens up as:



Edited 2020-08-03 19:27 by Volhout
If nothing goes right ... turn left
 
IanT
Newbie

Joined: 29/11/2016
Location: United Kingdom
Posts: 34
Posted: 10:05am 03 Aug 2020
Copy link to clipboard 
Print this post

That's very useful Volhout (at least to me!) - Thank you for taking time to reply

I will experiment with your examples and see if I can do what I had in mind.
[Sorry for being such a Dummy!]  

IanT
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 2743
Posted: 10:34am 03 Aug 2020
Copy link to clipboard 
Print this post

You can also give the CSV file an extension of .xls and it will open in Excel just like a file created in Excel.
Geoff Graham - http://geoffg.net
 
IanT
Newbie

Joined: 29/11/2016
Location: United Kingdom
Posts: 34
Posted: 04:33pm 03 Aug 2020
Copy link to clipboard 
Print this post

I'll try that too Geoff - thank you.   :-)

Regards,

IanT
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1329
Posted: 08:40am 04 Aug 2020
Copy link to clipboard 
Print this post

  lizby said  ... FORMAT$ if possible.


TassyJim did two excellent routines in native MMBasic for this, you can find them here http://www.fruitoftheshed.com/MMBasic.uFormat-and-StrE-provide-flexible-formatting-of-numeric-values.ashx?HL=format

<My 2p>

Setting the ground; I have little interest outside of the micro-controller applications, the workhorse MM2 & MM+ through to the mighty MMX and H7 covers it for me. DOS, PiCromite and CMM2, whereas great additions, offer little interest for me so in this discussion I will be  filling the role of nosy neighbour stopping by with unsought wisdom when you are under your car in the rain.  

Not attacking the idea of more commands... The problem is trying to keep everyone happy by adding a particular "Cause célèbre". I am of the mindset that additions to the language need to be primitives, utilitarian, building blocks more useful to more people. We have already seen the available command slots in CMM2Basic reduced to zero - They are clearly a precious commodity. In my field of interest, this is why I particularly like the MMBasic Lite edition - much of the (arguably) rarely used functionality is gone in favour of a leaner system - a tougher system. A few years back I had a very specific requirement for a fast count input and PeteM stepped in very generously with a CSub that does the job fantastically... a peculiar requirement executed within the confines of the language and no clutter added to the core.

Fringe stuff that can be done other ways, should be. With my students, I always bang this drum and compare an Airfix kit to Lego - With a kit, you can make a Lancaster bomber in superb detail - but that is all. With Lego you can make anything - it might just be a bit knobbly round the edges.

How many of us here (programmers) are even aware of the fringe math functions in VB6, (only really usable for financial institutions) let alone have used them (this is also why there is tons of VB6 still in banks - it is the "new" COBOL). But, VB can do this because it isn't trying to maintain a core language (other than other VBs) and space/power is no barrier. So who cares if there are bits of VB that have never seen the CPU in the majority of use cases?

I am guessing that all the above is bit moot what with the advancements in the 'Mite ecosphere anyway, soooo.... *shrugs*

</My 2p>
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 883
Posted: 12:17pm 04 Aug 2020
Copy link to clipboard 
Print this post

Cap'n -- thanks for the link to TassyJim's uFORMAT$ and eStr$ programs. Those will be helpful.

Re additional commands, I understand about adding new ones. So far, I personally have just wanted to include in MMBasic DOS some commands which are already in other MMBasic versions. I use MMBasic DOS a lot, especially for reading and manipulating text files, so that's why I'd like more of the string functions, and especially longstring.

But this morning upon waking up I had a thought about something new--not a command but this:
OPTION DEBUGGER ON/OFF [COM=3,9600] [Break=217,314] [watch=someVariable,anotherVariable ...]

With OPTION DEBUGGER ON, at the point where MMBasic is about to execute a new line, if a Break= line number is reached, the program bounces to ">" where the user can investigate and change values ("i=14") and CONTINUE or <Ctrl-C> to fully break out of the program. Watch=variables take an operator so that if they are = to some value (or >,<) something happens. COM=? means changed Watch variables are output to the specified COM port at the specified speed.

This is not fully fleshed out, and would have problems where the graphics output screen is the same as the console. Some way to single step after a Break needs to be thought out.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 2743
Posted: 01:29pm 04 Aug 2020
Copy link to clipboard 
Print this post

  CaptainBoing said  The problem is trying to keep everyone happy by adding a particular "Cause célèbre". I am of the mindset that additions to the language need to be primitives, utilitarian, building blocks more useful to more people.

I very much agree with you.

Often there are requests for this or that function which could easily be implemented in BASIC.  For example, I have often received requests to add to MMBasic a function to trim spaces from a string.  So often in fact that I ended up putting an example of how to write this simple BASIC function in the manuals.

I believe that a programming language should concentrate on the basics and anything extra which could be implemented in the language should not be included without a very good justification.  Adding too many "features" to a language results in a cluttered and hard to understand programming environment.

Geoff
Geoff Graham - http://geoffg.net
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1329
Posted: 02:29pm 04 Aug 2020
Copy link to clipboard 
Print this post

"the lizby step" - sounds like a dance move  

I use a very simple debug method that could easily be tweaked to do this - not with the flexibility of breaking out to the command prompt but it can certainly report when your are entering, during, leaving a given bit of code and could output variables.

here

what this does it allow you to turn debugging on/off under program control and keep a track of where in the program. I am old school and used TRON/TROFF a lot in years gone by but the usefulness of them has very much waned with the loss of line numbers. Now they report the physical line number of the text file... as you add/remove bits of code, the reported numbers move about and so when you have got accustomed to recognising certain lines, you lose all that and have to start again.

PStep puts nice sign-posts in your code and if the debug flag is on reports them to the console as each is reached. The Sub could be tweaked, per-requirement, to output (Global) variables too... wouldn't take much.

This little trinket has preserved my sanity a few times, but alas too late for my hairline  

hih

h
 
Print this page


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

© JAQ Software 2020