Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:30 03 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 : A beginner (almost), woes aplenty

     Page 2 of 2    
Author Message
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 02:36pm 26 Jul 2018
Copy link to clipboard 
Print this post

Quick post, my eyes not coping this late. My terminal has terrible status line colours for me. Now it looks dead easy to change this, example in the manual

SET MMCOLOURS=0,7,6,4,2,0,5


So if position last, the 5 is set to 7, this should be white?

Well I have tested in the windows terminal, global setting and I have set it in the MMBasic terminal and in the EDITOR? Nothing changes



The picture is worse than in real life, I can distinguish the purple colour.

 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 05:31pm 26 Jul 2018
Copy link to clipboard 
Print this post

... a bit late to this party...

"The channel is left open till the program explicitly closes it. Perhaps that is something worthy of change."

No. Really guys. Absolutely not. This is just getting the language to prop-up buggy coding.

There has always been a "file already open error" in MS Basics (error 55, since god was a lad, well at least since GWBasic and in every version since - QB, VB, VBA, VBS) and other dialects. Just because Sinclair basic introduced bad practice (one of many) doesn't mean it should be copied. A "fix" like this could be quite destructive to code and lead to bug-hunting which is far more complex than why you didn't close the file before you tried to re-use a stream number. ZXBasic is hardly the gold standard!

Implicit behaviour should be kept to a minimum otherwise the programmer loses control and ends up coding around it.Edited by CaptainBoing 2018-07-28
 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 02:24pm 27 Jul 2018
Copy link to clipboard 
Print this post

Tonights little exercise continued with the trying to change the statusline colours in the DOS MMBasic terminal.

> SYSTEM "SET MMCOLOURS=0,7,6,4,2,0,14"
>


I assume that means that statement is accepted, a change from syntax errors.

The figure 14 to change status line to bright yellow. Nothing has happened.

> system "set colours"
Environment variable colours not defined
Error: Command could not be run
>



I guess that is fair enough as listing the environment variables, do not show MMCOLURS been added

(listing variables with SYSTEM "SET" )Edited by plover 2018-07-29
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 05:34pm 27 Jul 2018
Copy link to clipboard 
Print this post

  plover said   Tonights little exercise continued with the trying to change the statusline colours in the DOS MMBasic terminal.

> SYSTEM "SET MMCOLOURS=0,7,6,4,2,0,14"
>


I assume that means that statement is accepted, a change from syntax errors.


I think it would run the SET fine but in a sub-shell which then exits.

So it would overall achieve nothing useful.

John
 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 01:36pm 28 Jul 2018
Copy link to clipboard 
Print this post

JohnS
Thank you for posting, I did wonder about the possibility that another shell was opening and closing because I thought a noticed a flicker for perhaps quarter second as if the console gave a shiver.

I am givin up for the time being on trying to change the status line colours when using the 'edit' mode. My last attempt was to follow the line

  Quote  In windows using this:
Control Panel => System => Advanced system settings => Environment Variables, when here added a new two line entry

Name: MMCOLOURS
Value: 0,7,6,4,2,0,14


This did not seem to have any effect until about an hour later a couple of times the konsole show yellow status line text and grey background.

"How hard can it be?? well I am finding out for me it is overwhelming

To get away from those variables I decided to have a play with the character set and work the 'edit' window. Where the F2 and F4 to run and return to edit if an error shows up. That is really nice and simple. Also figured out the copy and paste using F5.

I am attaching a little program that may or may not present two problems. The first one is the programs stops unexpected the second will change colouring of the 'edit' on my system, the syntax highlighting goes wrong, and decapitates the program. Best I stop playing for the night I will end up walking the ceiling upside down.



2018-07-28_232943_p9-char-set.zip


 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 03:02pm 02 Aug 2018
Copy link to clipboard 
Print this post

I just played around with my file from previous post, discovered that

Print chr$(7)

Must be a LF well it works like that and also squaks at me, reminding me of morse code.

Does anybody know if there is a morse code generator of form, in the "fruitshed", when I have slept I will remember what the real name it is I am after.

2018-08-03_010152_p9-char-set-2.zip
Edited by plover 2018-08-04
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3379
Posted: 03:15pm 02 Aug 2018
Copy link to clipboard 
Print this post

chr$(7) is the Ascii BELL character--that's why it squawks at you. Per the manual, "PRINT" without ";" at the end sends carriage return / newline.
Edited by lizby 2018-08-04
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Boppa
Guru

Joined: 08/11/2016
Location: Australia
Posts: 814
Posted: 12:20am 03 Aug 2018
Copy link to clipboard 
Print this post

https://www.asciitable.com/ for a full listing of ascii codes
 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 09:28am 03 Aug 2018
Copy link to clipboard 
Print this post

lizby
I had an inkling that I was wrong with chr$(7) but since it seemed to give me the NL (New Line) I was looking for I ignored my sixth sense banging me on the head drawing my attention to the number should be over 10.

Well I had to go and check a bit better and recognised chr$(13) which I have put through the test in the little file attached.

Boppa
The ASCII link came in handy for looking up the values below 33, I think I will make a copy and put in the directory that I work in with MMBasic for DOS.

2018-08-03_192758_p9-char-set-3.zip
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 203
Posted: 07:50pm 15 Sep 2020
Copy link to clipboard 
Print this post

Earlier postings in this thread discuss setting environment variables.  I'm seeing some weird behavior in mmBasic for DOS, and wonder if I'm alone.

I've set up the external editor to use Notepad++ (just can't unlearn ctrl-c & ctrl-v - sorry!), and the file location to be on my SD card receptacle, E:.  mmBasic is able to see files in that location (when I do a 'files' command within mmBasic) and load files from that location with no further qualification ('load "life.bas")

System variables are set up to use double quote marks (for Notepad++, which is in the "...Program files..." subdirectory, requiring quotes, and for safety's sake, for my SD card:



However, when I do a 'System "set"' command inside mmBasic, this is what I get:



which is missing the right-hand quote.  And when I quit Notepad++ after editing a Basic program, I get this: for MMDIR:




I've also tried putting double double quotes at the end of the string (""), and removing quotes from the string, and removing quotes but putting a backslash at the end of the string - all to no avail.

Is this a bug or a feature?

Thanks!

- Steve
Edited 2020-09-16 07:46 by NPHighview
Live in the Future. It's Just Starting Now!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 11:32pm 15 Sep 2020
Copy link to clipboard 
Print this post

I don't know what is going on here but I do not think that it is a MMBasic issue (environment variables with quotes work for me).

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

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 203
Posted: 11:40pm 15 Sep 2020
Copy link to clipboard 
Print this post

Thanks, Geoff -

I'll poke around and see if I can narrow the focus a bit more.  I'm running mmBasic 5.05.03 on Windows 10 64-bit Pro, Bootcamp, on a MacBook, so there's plenty of opportunity for funny business.

By the way, this whole ecosystem is marvelous.  Thanks so much!  Reminds me (very pleasantly) of programming on HP-9845 desktop computers in the late 1970's / early 1980's, but with the opportunity to talk one-on-one with the creator!

- Steve
Live in the Future. It's Just Starting Now!
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 203
Posted: 07:20pm 16 Sep 2020
Copy link to clipboard 
Print this post

Geoff - I installed mmBasic for DOS on an entirely different computer (a Dell laptop running Windows 10, native), and instead of using the Settings to establish the environment variables, I wrote a small batch file to do so on the way in to mmBasic:

SET MMDIR=E:\mmBasic\projects
SET MMEDITOR="C:\Program Files (x86)\Notepad++\Notepad++.exe"
"C:\Program Files\mmBasic\mmBasic.exe"
cls


Note the lack of quote marks around MMDIR.

mmBasic comes right up, and shows the contents of the subdirectory on the SD card in E: but when I load mc_pi.bas, shell out to the external editor, make a tiny change, save, and return, I still get this:

> load "mc_pi.bas"
> wedit
Error : Expected a string
>


and the file listing in mmBasic doesn't show the change I had made.  

Just to be sure that the problem isn't with Notepad++, I changed the batch file to invoke Microsoft's Notepad:

SET MMDIR=E:\mmBasic\projects
SET MMEDITOR="Notepad.exe"
"C:\Program Files\mmBasic\mmBasic.exe"
cls


mmBasic still shells out successfully to Notepad, has the program loaded, but when I save & exit, I get the same "Error : Expected a string" message, and the file in mmBasic's memory is unaltered.

To be trebly sure, I downloaded & installed the Atom IDE, which is pretty huge.  I saw the "Error : Expected a string" message come up in mmBasic as it was shelling out, not upon the return from the external editor.

So, this has eliminated:
* The host PC
* The external editing environment
* The setting of environment variables through "Settings" vs. command line

What's still in common:
* Windows 10 Pro 64-bit
* mmBasic version 5.05.03
* The "Error : Expected a string" message, regardless of external editor

Your thoughts?
Live in the Future. It's Just Starting Now!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 08:26am 21 Sep 2020
Copy link to clipboard 
Print this post

Early in this thread mention was made of using immediate mode and the problem of doing anything complicated. When trying program fragments layout what you want to do in Notepad, duplicate it then reduce the copy to one line with ":" at each line end. This can be up to 255 characters long (spaces included). Then copy and paste that line into MM Basic. If the line is a little over 255 replace every "PRINT" with "?" and remove as many spaces as possible.
If it doesn't work first time you haven't wasted all your typing, just edit the notepad file and try again.
 
     Page 2 of 2    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025