Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:37 11 May 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 : MMBasic for Windows - alphas

     Page 9 of 12    
Author Message
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 572
Posted: 04:06am 23 Feb 2022
Copy link to clipboard 
Print this post

Edit "Click.bas
Plasma
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 10:38am 23 Feb 2022
Copy link to clipboard 
Print this post

Good morning Peter,

Here are four for your delectation:

1. OPTION DEFAULT MODE without an argument (done through fat fingers) hangs and then crashes MMB4W.

2. Setting OPTION DEFAULT FONT <num> and then using FILES or causing an ERROR returns to the font that MMB4W was originally started with instead of the new DEFAULT FONT.

3. Weird EXECUTE sh*t, note the mysterious "0" at the start of the path it tried to open:



Also can I suggest that:

4. You should actively prevent the user typing a command at the prompt longer than the window (ideally sound the bell) instead of:



... or even better support commands at the prompt that extend over multiple lines (up to the usual 255 character limit).

Best wishes,

Tom
Edited 2022-02-23 20:40 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 11:01am 23 Feb 2022
Copy link to clipboard 
Print this post

Tom

Thanks for the reports - all trivial except 4. This is the same on all versions (certainly my ones) and is very difficult to trap - I'll think about it but can't see a sensible way at the moment.

On 2 it will return to the default font if in the default mode. If in another mode it will return to a defined sensible default for that mode. This is because after an error you need to know the error message will display which if, for example, you were using the font with only large numbers, it couldn't


MMBasic.zip

Mauro: This version has OPTION ANGLE implemented as per CMM2
Edited 2022-02-23 21:05 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 11:06am 23 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  Thanks for the reports - all trivial except 4. This is the same on all versions (certainly my ones) and is very difficult to trap - I'll think about it but can't see a sensible way at the moment.


Yep, I thought it didn't happen with MMB4L, but fortunately I checked before gloating . I've added it to my "issue list".

Will give latest version a spin tomorrow morning; I need to ration my time on this, I spent too much time shedding yesterday and not enough time on the day job.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 11:59am 23 Feb 2022
Copy link to clipboard 
Print this post

V5.07.03a9



MMBasic.zip


This version will give a beep when entering a command at the command line as you type the second last character that fits on the screen or if you insert characters that cause the last character to be the second last one that fits on the screen. If you go past this the command will be corrupt but the firmware won't actually stop you.

GUI BEEP [duration] also implemented
QUIT was implemented some time ago in case you haven't noticed
Edited 2022-02-23 22:01 by matherp
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 03:57pm 23 Feb 2022
Copy link to clipboard 
Print this post

Hi Peter,
maybe not so important, but SHIFT+SPACE does nothing, on CMM2 produces standard SPACE. I'm writing BASIC commands in upper case so I'm pretty often not fast enough to release SHIFT before I press SPACE. The because I'm looking to the keyboard and not the screen, I find later all my commands are one long word...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 06:37pm 23 Feb 2022
Copy link to clipboard 
Print this post

V5.07.03a10


MMBasic.zip


Getting close to beta status  

Option colourcode now working
WATCHDOG command now working
SHIFT-space sends the same as space
Timeout on invalid EXECUTE commands now working
option autorun now working
option autorun will run the last file run, loaded, edited, or autosaved i.e. whatever is shown by mm.info(current)
The last file will now be remembered between runs on MMBASIC so if you were working on myfile.bas and then shut down basic, next time you run it you can use EDIT without a filename. Likewise autorun will act as expected whenever MMbasic is started.
RESTART command restarts the Basic thread (same as CPU RESTART on othe MMbasic ports)

NB: If you specify a file name to run with the MMBasic command this will override any previous file due to be autorun
NB: This version will clear all options the first time it is run
NB: if you get into a mess with autorun then just delete the .options file in MyDocuments
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 572
Posted: 02:20am 24 Feb 2022
Copy link to clipboard 
Print this post

first run (F2)  from editor shows nothing
second F2 then is working

original cmm2 need only one hit on f2.

it works but not like the original    you asked for  
Edited 2022-02-24 12:21 by Plasmamac
Plasma
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 06:49am 24 Feb 2022
Copy link to clipboard 
Print this post

Is F1, or the FILES command, from the console screen going to work like the CMM2 where you can scroll the list of files/folder select a file to run/edit a file or display a picture, or play a mp3/wav/etc, or open a folder to select a file to to run/edit and that folder then becomes the default folder for the interim? I just want an easy way to manage program folders... and I'm assuming I haven't missed something obvious but I do have age as a factor!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 07:59am 24 Feb 2022
Copy link to clipboard 
Print this post

  Quote  first run (F2)  from editor shows nothing
second F2 then is working


Works perfectly for me - you need to describe exact sequence and provide problem code

  Quote  Is F1, or the FILES command, from the console screen going to work like the CMM2 where you can scroll the list of files/folder select a file to run/edit a file or display a picture, or play a mp3/wav/etc, or open a folder to select a file to to run/edit and that folder then becomes the default folder for the interim?


My current thoughts were that this isn't necessary on a machine with a full OS and separate filemanager application - what is the consensus on this?  thoughts?
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 08:07am 24 Feb 2022
Copy link to clipboard 
Print this post

Hi,

How to clear (delete) a program from MMBASICA memory?
Why doesn't the console add lines with numbers to the program in memory, as is the custom of BASIC?

Michal
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 08:10am 24 Feb 2022
Copy link to clipboard 
Print this post

  Quote  How to clear (delete) a program from MMBASICA memory?

NEW
  Quote  
Why doesn't the console add lines with numbers to the program in memory, as is the custom of BASIC?

No versions of MMBasic do that since the original Maximite. Line numbers are only there for legacy support, are not needed, and should not be used for new programs. Use the editor to enter a new program
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7505
Posted: 08:14am 24 Feb 2022
Copy link to clipboard 
Print this post

Regarding F1 and FILES, I'm unsure. If MMBasic is an application rather than an emulation then the OS's file management should be used, as that's what applications do. However, if you want to emulate the CMM2 then F1 and FILES should probably do something similar to that really.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 08:46am 24 Feb 2022
Copy link to clipboard 
Print this post

My only concern was that using separate folders for each programme seems iffy....

If I associate .bas files with MMB4W the programs run fine when double clicked as long as any associated files are in the option default folder - which can make it a very busy folder.

Of course things work well if I use CHDIR/MKDIR etc commands but MMB4W is a mouse using program and I'm just used to point and click. So, no biggy - just have to change my working habits.
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 08:54am 24 Feb 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  if you want to emulate the CMM2 then F1 and FILES should probably do something similar to that really.
I'd rather see a Windows file selector come up rather than the text based CMM2 file selector.
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 09:05am 24 Feb 2022
Copy link to clipboard 
Print this post

  Goksteroo said  
  Mixtel90 said  if you want to emulate the CMM2 then F1 and FILES should probably do something similar to that really.
I'd rather see a Windows file selector come up rather than the text based CMM2 file selector.

Or maybe something like MC, NC, TC, FC?

Michal
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 10:13am 24 Feb 2022
Copy link to clipboard 
Print this post

Good morning Peter,

A fresh selection for your delectation:

1. Setting OPTION DEFAULT PATH immediately changes the current working directory to the new default path. Is this intended? I was suprised.

2. CHDIR into a non-existing directory produces a "rubbish" error message:


3. I think you should add a mechanism to read environment variables (it would certainly help with my unit-test framework), especially HOMEDRIVE, HOMEPATH and TMP. MMB4L uses MM.INFO$(ENVVAR name$) though that obviously can't handle > 255 chars for which MMB4L users would currently need to use SYSTEM.

4. MM.INFO$(DIRECTORY) does not work the same in MMB4W as it does on the CMM2 (or MMB4L). On the CMM2 you always append the separator "/" but in MMB4W you currently don't append a separator ("\") except when the current directory is the root, e.g. "C:\". Note that CWD$ and MM.INFO$(DIRECTORY) historically have different behaviour in that CWD$ only appends the path separator when the current directory is the root, e.g. "A:/"

5. YMMV but it would aid portability if all your MMBasic implementations supported MM.INFO$(SEPARATOR) to return "/" or "\" as appropriate ... that's assuming you don't want to force MMB4W to automatically convert to the "/" separator used by the CMM2.

Best wishes,

Tom
Edited 2022-02-24 20:15 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 10:46am 24 Feb 2022
Copy link to clipboard 
Print this post

  Quote  1. Setting OPTION DEFAULT PATH immediately changes the current working directory to the new default path. Is this intended? I was suprised.

Yes, it was intended

  Quote  CHDIR into a non-existing directory produces a "rubbish" error message:

Fixed

  Quote  I think you should add a mechanism to read environment variables

I can do TMP but have no idea what HOMEDRIVE, HOMEPATH are in a windows context? I can provide the users documents directory

  Quote  MM.INFO$(DIRECTORY) does not work the same in MMB4W as it does on the CMM2

Fixed

  Quote  YMMV but it would aid portability if all your MMBasic implementations supported MM.INFO$(SEPARATOR) to return "/" or "\" as appropriate ... that's assuming you don't want to force MMB4W to automatically convert to the "/" separator used by the CMM2.


My ports allow / and \ to be used interchangeably ( except if I missed one) certainly the windows code does.
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 572
Posted: 10:59am 24 Feb 2022
Copy link to clipboard 
Print this post

F2 double click

1 . Start mmb a10
2 . Type edit "fantasyname : enter
3 . Type print timer: enter
4 .  Press F2
5.  Window show : > + cursor
6. Press F2
7. window show
Run
Timerresult
>+ cursor

On cmm2 at point 4. the programm starts , show pointer and cursor.

Hope this help
Plasma
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 11:01am 24 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I think you should add a mechanism to read environment variables

I can do TMP but have no idea what HOMEDRIVE, HOMEPATH are in a windows context? I can provide the users documents directory


I believe HOMEDRIVE and HOMEPATH are standard Windoze. Open a CMD prompt and type "SET HOMEDRIVE" and "SET HOMEPATH".

In any case I was hoping you could be persuaded do it generally not just for specific environment variables, i.e. implement MM.INFO$(ENVVAR name$) in terms of the Windows API function GetEnvironmentVariable().

In MMB4L the equivalent code looks like:

static void mminfo_envvar(char *p) {
   char *name = getCstring(p);
   char *value = getenv(name);
   if (!value) value = "";
   if (strlen(value) >= STRINGSIZE) {
       error("Environment variable value too long");
   }
   g_string_rtn = GetTempStrMemory();
   g_rtn_type = T_STR;
   strcpy(g_string_rtn, value);
   CtoM(g_string_rtn);
}


  matherp said  
  Quote  YMMV but it would aid portability if all your MMBasic implementations supported MM.INFO$(SEPARATOR) to return "/" or "\" as appropriate ... that's assuming you don't want to force MMB4W to automatically convert to the "/" separator used by the CMM2.


My ports allow / and \ to be used interchangeably ( except if I missed one) certainly the windows code does.


That's true on input, but the problem is with returned paths where CMM2 uses "/" and MMB4W uses "\" which makes unit-testing the results a little harder than it might be. Anyway, just a suggestion I'm capable of working around it by defining a CONST SEPARATOR$ in terms of the value of MM.DEVICE$ or writing a "canonicalisation" function.

Best wishes,

Tom
Edited 2022-02-24 21:02 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 9 of 12    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025