Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 03:16 12 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 : MMBasic for DOS Beta 6

     Page 3 of 5    
Author Message
Peter63
Newbie

Joined: 28/07/2017
Location: Sweden
Posts: 14
Posted: 10:35am 04 Aug 2017
Copy link to clipboard 
Print this post

Hi, Geoff

I have used a GPS-module to test serial communication in MMBasic DOS 5-04-05 Beta 6
and it works well. I defined all COM parameters to get it working, not just baud-rate.

I included test program gps-test.bas and GPS-modul info.
2017-08-04_203513_gps-test.zip


Peter
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 11:55am 04 Aug 2017
Copy link to clipboard 
Print this post

  robert.rozee said  unfortunately i've not been able to capture stdout from mmbasic.exe. even cmd.exe can not redirect it, ie
MMbasic myprog.bas > abc.txt
does not redirect the console output.

This is something I have not tested. I will look into it.

Geoff

Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2292
Posted: 05:22pm 04 Aug 2017
Copy link to clipboard 
Print this post

below is a demo of the program i'm developing:

2017-08-05_003446_console_demo.zip

run Project1.exe to strt the demo. all the other files are the delphi source code.

there are two buttons, RUN and STOP. if you press RUN a dialog box will pop up and ask you for the program to run. the line can contain parameters, just like the command prompt. type CMD to run the console.

when finished running the program (or if it fails to interact) press STOP. or, if the program supports exiting, exit it instead. for instance, typing EXIT from within CMD will cause the same effect as pressing STOP. note that while a program is running the window will not close until you press STOP.

when no program is running, keypresses are echoed like with a typewriter.

when a program is running all input is echoed locally, which is currently necessary to use CMD.EXE. this may cause double characters to appear when running some programs. remember: this is just a demo!

i'd appreciate any/all feedback.


cheers,
rob :-)Edited by robert.rozee 2017-08-06
 
flip
Senior Member

Joined: 18/07/2016
Location: Australia
Posts: 114
Posted: 01:06am 07 Aug 2017
Copy link to clipboard 
Print this post

Rob,
It all works like you said. I like the tiny font which is really clear and efficient. I guess you're making like a windows shell wrapper thing. Had no crashes and no noticeable system overheads on my el-cheapo Windows 10 system. Interesting to see where you take it.

Regards Phil.

 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1138
Posted: 07:14am 12 Aug 2017
Copy link to clipboard 
Print this post

Bug or feature?

Hi Geoff,

I've got the strong impression that MMBasic for DOS Beta 6 erases (eats? ) blank lines after loading into the editor.

Something for the bug list.

Best regards
Michael
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 11:53am 12 Aug 2017
Copy link to clipboard 
Print this post

No, it doesn't (or rather should not). It does "eat" spaces that should not be there. For example DIM arr (10) will be converted to DIM arr(10).

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

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1392
Posted: 12:15pm 12 Aug 2017
Copy link to clipboard 
Print this post

  twofingers said   Bug or feature?
I've got the strong impression that MMBasic for DOS Beta 6 erases (eats? ) blank lines after loading into the editor.
Best regards
Michael


Interesting, whenever I test a short programs in Beta 6, going into Edit mode always removes every blank line between the lines of code and squishes it altogether, I have to put a comment mark on every line that I want to keep blank after a Run Edit cycle.

Mike.Edited by KeepIS 2017-08-13
It's all too hard.
Mike.
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1138
Posted: 01:14pm 12 Aug 2017
Copy link to clipboard 
Print this post

Finally someone who understands me!

Michael
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 06:20am 13 Aug 2017
Copy link to clipboard 
Print this post

It does "eat" blank lines!

It must be something to do with the mechanism for handling variations in CR and LF terminators. I will investigate and fix.

Geoff
Geoff Graham - http://geoffg.net
 
flip
Senior Member

Joined: 18/07/2016
Location: Australia
Posts: 114
Posted: 08:43pm 13 Aug 2017
Copy link to clipboard 
Print this post

Hi Geoff,
Also while you have MMBasic for DOS code open, can you swap MM.HRES and MM.VRES?
..e.g. MM.HRES reports 25 and MM.VRES reports 80 using a standard DOS window.

(...sorry if you already had this in hand from my earlier post...)
Regards,
Phil
 
flip
Senior Member

Joined: 18/07/2016
Location: Australia
Posts: 114
Posted: 09:33pm 17 Aug 2017
Copy link to clipboard 
Print this post

Hi Geoff,
A problem I just found with MMBasic for DOS beta 6 ...typing NEW doesn't seem to make MMBasic "forget" the file name?

Steps done
Create a useful AUTORUN.BAS in the same directory as EXE (i.e. as per manual) OR start MMBASIC with an explicit BAS file in the command line
Start MMBASIC.EXE (the autorun.bas or whatever runs fine)
Type NEW to clear the program space
Type EDIT to edit some new code
Press F1 and it overwrites whatever your original file was when starting MMBASIC

Alternatively if MMBasic is started with no file, no command line
Press F1 from editor does not seem to save the file anywhere (but I haven't scoured the whole computer for it)

So would it be possible for the NEW command to both "forget" the current filename and also cause the F1:Save key in the Editor to either fail or prompt for a file name?

Regards,
Phil
Edited by flip 2017-08-19
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 11:42am 18 Aug 2017
Copy link to clipboard 
Print this post

  flip said  So would it be possible for the NEW command to both "forget" the current filename and also cause the F1:Save key in the Editor to either fail or prompt for a file name?

OK, good point. I will fix it in the next release (which should be soon).

Geoff
Geoff Graham - http://geoffg.net
 
Peter63
Newbie

Joined: 28/07/2017
Location: Sweden
Posts: 14
Posted: 09:30pm 18 Aug 2017
Copy link to clipboard 
Print this post

MMBasic Beta6 , Found this?
- - - - - - - - - - - -
>save
Error: Syntax

Always need to enter file-name now: save "test1"

- - - - - - - - - - - -
colour fc,bc don't work
give an error

color fc,bc works fine
- - - - - - - - - - - -
Peter



 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 10:00pm 18 Aug 2017
Copy link to clipboard 
Print this post

  Peter63 said  Always need to enter file-name now: save "test1"

Yes, that is correct.

  Peter63 said  colour fc,bc don't work
give an error

Thanks, COLOUR seems to have gone "missing in action". I will fix it in the next release.

Geoff
Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2292
Posted: 11:12pm 18 Aug 2017
Copy link to clipboard 
Print this post

there appears to be a couple of bugs in mmbasic 5.04.05, which is likely in all other versions that use VT escape sequences in the editor.

1. when option colourcode on is selected, upon exit the editor sends the following sequences:
<ESC>[0m
<ESC>[30m
<ESC>[30m

the first resets all attributes to their default: bright white text on a black background. but the second and third both set the foreground colour to black.

i'm guessing the two <ESC>[30m's were originally intended to set a foreground and background colour (with parameters of 37 and 40), but somehow got muddled over time. they need to be removed.

teraterm, when it detects the problem of the black text on a black backgound, remaps to a more 'visible' pairs of colours - bright white on black. this completely masks the bug at the command prompt.

2. when option colourcode on is selected, within the editor the micromite makes use of 25% grey on black for some text. readable in GXFterm, but a problem with teraterm as it comes out as black on black (teraterm misses fixing this one).


the fix:
- upon exiting the editor, remove the two superfluous <ESC>[30m's.
- instead of using grey on black text (actually bright black on black) use white on black.


cheers,
rob :-)
Edited by robert.rozee 2017-08-20
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 04:14am 19 Aug 2017
Copy link to clipboard 
Print this post

Thanks Rob. Another one for investigation and fix in the next release.Edited by Geoffg 2017-08-20
Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2292
Posted: 06:55am 19 Aug 2017
Copy link to clipboard 
Print this post

a little off topic perhaps, but...

the following program demonstrates using a scroll window on a VT terminal. using a scroll window would eliminate the current need to redraw the status line in the editor.

the method used is to set up the scroll region, do the scroll, then set the scroll region back to the full screen. this involves a few more escape codes, but simplifies everything else outside of the scrolling code.

the code has been tested against teraterm and GFXterm, but not a real VT100. it only requires the following scrolling-specific escape sequences be implemented:
<esc> [ Pn ; Pn r
<esc> D
<esc> M


Const ESC=Chr$(27)

Print ESC "[2J" ESC "[H";
For I=1 To 24
Print I, " #", " #", " #", " #", " #";
If I<24 Then Print
Pause 200
Next I ' screen now filled with 'stuff'
Pause 2000


For I=101 To 140
Print ESC "[20;1H"; ' move cursor to start of line 20
Print ESC "[K"; ' clear to end of line
Print ,,I, "hello world", I; ' print our message
Pause 200

Print ESC "[5;20r"; ' set window from lines 5 to 20 (inclusive)
Print ESC "[20;1H"; ' move cursor to start of line 20
Print ESC "D"; ' scroll windowed area UP
Print ESC "[r"; ' reset windowed area to lines 1 to 24
Next I


Print ESC "[20;1H"; ' move cursor to start of line 20
Pause 2000
For I=5 To 20: Print ESC "[" Str$(I) ";1H" ESC "[K";: Next I
Pause 2000


For I=201 To 240
Print ESC "[5;1H"; ' move cursor to start of line 5
Print ESC "[K"; ' clear to end of line
Print ,,I, "drink water", I; ' print our message
Pause 200

Print ESC "[5;20r"; ' set window from lines 5 to 20 (inclusive)
Print ESC "[5;1H"; ' move cursor to start of line 5
Print ESC "M"; ' scroll windowed area DOWN
Print ESC "[r"; ' reset windowed area to lines 1 to 24
Next I


Print ESC "[4;1H"; ' place cursor at start of line 4



cheers,
rob :-)Edited by robert.rozee 2017-08-20
 
Peter63
Newbie

Joined: 28/07/2017
Location: Sweden
Posts: 14
Posted: 09:25am 19 Aug 2017
Copy link to clipboard 
Print this post

Hi Geoff

I found this, >new command don't erase the last filename in consol-window?



Peter
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 02:07pm 19 Aug 2017
Copy link to clipboard 
Print this post

If I understand correctly, is this the same as flip's comment 8 posts back?
Geoff Graham - http://geoffg.net
 
flip
Senior Member

Joined: 18/07/2016
Location: Australia
Posts: 114
Posted: 12:03pm 21 Aug 2017
Copy link to clipboard 
Print this post

Hi all,
1. Peter hasn't responded but I think he means the title-bar of the Console Window...maybe if it could either remove the filename or display something like MMBasic - Untitled

2. Also re Geoff's first post,
  Quote  I have used this to remotely control a Micromite and it works well. The only hiccup is that a few times I needed to access the port using Tera Term first - I will be interested on the experience of others


I have same problem. I use Jim's MMEDIT, and similarly after chatting to uMite successfully it seems to work afterwards (even resetting uMite makes no difference either way) - for me it seems like a switch has been flicked in Windows for that port until Windows is shutdown.
Does anyone have any hints to solve this consistently? I might do some ferreting on the web..

Regards Phil
 
     Page 3 of 5    
Print this page
© JAQ Software 2024