Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: MMBasic for DOS Beta 6 Post ReplyPost New Topic
<< Prev Page of 8 Next >>
Author
Message << Prev Topic | Next Topic >>
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2135
Posted: 22 August 2017 at 1:21am | IP Logged Quote Geoffg

flip wrote:
Peter hasn't responded but I think he means the title-bar of the Console Window

Thanks Phil, that makes sense. I will fix it.

Geoff


Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2257
Posted: 22 August 2017 at 2:14am | IP Logged Quote TassyJim

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 haven't been able to reproduce the error.
I tried rebooting windows with the USB adapter left plugged in and with it plugged in after rebooting.
The serial port code worked first time with both scenarios.

Windows 10 with a Silicon Labs adapter.

I will try with a microbridge next.

Jim
Edit:
No problems talking to a MMX so have trouble blaming the adapter.
The code I use for testing is
Open "COM6: baud=38400" As #5
Print #5, "print mm.ver"
Pause 100
dat$ = Input$(20, #5)
Print dat$
Close #5


You need the pause 100

Jim

Edited by TassyJim on 22 August 2017 at 2:23am


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
flip
Regular Member
Regular Member


Joined: 18 July 2016
Location: Australia
Online Status: Offline
Posts: 61
Posted: 22 August 2017 at 4:18am | IP Logged Quote flip

Thanks Jim! I had thought you'd put some 'magic' in your code...(and was fishing for it ...but as usual I was off-track - it's finally clicked...

When I installed MMEDIT, I had to get my son's permission(!) as he owned the laptop at the time. I have since taken it over from him - at the great expense of providing him a better one ...but I digress...


When I run MMBasic for DOS, it runs as my non-Admin user.

When I run MMEDIT (or any program installed as Admin which uses a serial port) as a non-Admin user it seems to permanently set a flip-flop to allow the serial port to work correctly there-afterwards

So it's a rights issue over the serial ports (for me at least)...hope this helps someone...

May need to go in the 'MMBasic technical reference manual'...which leads me to another point...
IF no-one is doing this AND Geoff agrees, I would like (with Geoff's permission /content vet of course) to help compile a public list of features/specs/limitations/design decisions/alternative ways of doing things with examples...(i.e. stuff that would bloat the manual, but is helpful for those head-banging moments)..I was even thinking of a small MMBasic library program to use keywords to drive a large reference database sitting on an SD card or DOS file...may regret this offer but right now it seems like an exciting challenge.

Regards,
Phil

Edited by flip on 22 August 2017 at 4:36am
Back to Top View flip's Profile Search for other posts by flip
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2135
Posted: 22 August 2017 at 5:13am | IP Logged Quote Geoffg

flip wrote:
IF no-one is doing this AND Geoff agrees, I would like to help compile a public list of features/specs/limitations/design decisions/alternative ways of doing things with examples.

Go for it Phil.
It does sound like a big job.

Geoff
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2135
Posted: 22 August 2017 at 6:22am | IP Logged Quote Geoffg

Attached is Beta 7 of the DOS version of MMBasic.
2017-08-22_072750_DOS_MMBasic_5.04.05_Beta_7.zip

This fixes all reported issues:
- The EOF() and LOF() functions now work as expected on serial ports.
- The COLOUR command is reinstated and works as it should.
- MM.HRES and MM.VRES now report the correct values.
- The EDIT, WEDIT, SAVE and LIST commands no longer "eat" empty lines.
- The NEW command will cause the current program file name to be "forgotten" .
- The EDIT command will prompt for a file name when saving if there is not a current file.
- The file name in the title bar of the console windows is now updated correctly.

I tried sending the text output to stdout but it got too complicated. The way MMBasic is implemented (with EDIT, the command prompt, etc) it is not a straight scripting language and does not lend itself to redirecting the input or output. I will however have another shot at it later as it would be a handy feature.

Another "feature" that I have left for later is using a Windows file selector dialog box for some functions.

Finally, I have discovered that Windows is not buffering the serial output (it does buffer input). Therefore LOF() for serial output will always return zero. Buffered output can be implemented but the way that Windows does it is quite complicated and I'm not sure that it is worth the issues that it brings.

Geoff

Edited by Geoffg on 22 August 2017 at 2:35pm
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
robert.rozee
Guru
Guru


Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 1160
Posted: 24 August 2017 at 9:12am | IP Logged Quote robert.rozee

hi geoff,
you've produced another great accomplishment

there does seem to be a small problem with the files command:
DOS MMBasic Ver 5.04.05 Beta 7
Copyright 2011-2017 Geoff Graham

> files "*.z"
 Volume in drive C is OS
 Volume Serial Number is 3E75-E877

 Directory of C:\Documents and Settings\admin
 firmware\DOS version

File Not Found
Error: Error running DIR
>

i would have thought finding no files should not generate an error message.

i've been doing quite a bit of experimenting with using just stdin and stdout, microsoft certainly don't make it easy to do anything interactive without having to go to the console's win32 API. the only elegant solution i've had much success with is creating a separate thread to handle stdin. see the attached example (delphi/pascal source and a compiled .exe) it just echos keypresses back, while at the same time maintaining a 'spinning' cursor:
2017-08-24_080027_test_with_thread.zip
after a character is read, the 2nd thread sits in a tight loop until the main thread uses the character (it really should be placed in a queue), then blocks at the next read from stdin until a key is pressed. meanwhile, the main thread freely animates the cursor.

just an idea: have you though of a commandline switch, such as "/C" to switch between interactive and console modes? if /C is specified then the editor would be disabled, along with any calls to the console API, leaving just standard reads and writes to deal with. this may make the whole process much easier to achieve.


cheers,
rob :-)



Back to Top View robert.rozee's Profile Search for other posts by robert.rozee
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2135
Posted: 24 August 2017 at 10:18am | IP Logged Quote Geoffg

robert.rozee wrote:
just an idea: have you though of a commandline switch, such as "/C" to switch between interactive and console modes? if /C is specified then the editor would be disabled, along with any calls to the console API, leaving just standard reads and writes to deal with. this may make the whole process much easier to achieve.

That sounds quite workable. Error messages could go to stderr.

Thanks, I will explore in that direction.
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
flip
Regular Member
Regular Member


Joined: 18 July 2016
Location: Australia
Online Status: Offline
Posts: 61
Posted: 25 August 2017 at 4:05am | IP Logged Quote flip

Hi Geoff,
Thanks for your great work on this.

Just one small issue, on big screens, MM.VRES and MM.HRES report correctly up to 255 but then roll around to 0.

Also on this theme, there is a POS command for horizontal position (which does work over 255). Is there or if not would it be easy to provide a function that returns vertical position? It would be nice to save and restore current screen position during a subroutine call.

EDIT Another request (may apply to uM?) Can the String$ function be altered to work with any integer 0-255? It currently reports Error: xxx is invalid (valid is 32 to 126) When using an Integer as the second parameter (works fine with a string constant as second parameter)
So it can work with data other than Ascii strings.
> ? String$(10,255)
Error: 255 is invalid (valid is 32 to 126)
> ? String$(10,Chr$(255))

> ? String$(10,65)
AAAAAAAAAA
>

Regards,
Phil

Edited by flip on 25 August 2017 at 9:29am
Back to Top View flip's Profile Search for other posts by flip
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2135
Posted: 26 August 2017 at 3:04am | IP Logged Quote Geoffg

Are you talking about the DOS version? That would be a very big screen that is more than 255 characters wide.

I will look into a function that returns the current cursor position.

Thanks for the note on STRING$() I will fix it in the next version.

Geoff
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
darthmite
Senior Member
Senior Member
Avatar

Joined: 20 November 2011
Location: France
Online Status: Offline
Posts: 221
Posted: 27 August 2017 at 10:59am | IP Logged Quote darthmite

flip wrote:


EDIT Another request (may apply to uM?) Can the String$ function be altered to work with any integer 0-255? It currently reports Error: xxx is invalid (valid is 32 to 126) When using an Integer as the second parameter (works fine with a string constant as second parameter)
So it can work with data other than Ascii strings.
> ? String$(10,255)
Error: 255 is invalid (valid is 32 to 126)
>

Regards,
Phil


Hi Phil ,
note that character table (32 to 126) are the ascii code we normaky use , over 126 (127 to 255) they are special charracters (1 to 31 too),
chr$(under 32 and over 126) clean probably the wrong values (i don't have look the source since ages ;) )

__________________
Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
Back to Top View darthmite's Profile Search for other posts by darthmite
 
flip
Regular Member
Regular Member


Joined: 18 July 2016
Location: Australia
Online Status: Offline
Posts: 61
Posted: 28 August 2017 at 11:05pm | IP Logged Quote flip

Hi Geoff,
Yes, I tried it on a 4k monitor (ACER UHD4K2K great for programming at $499)- so with standard Windows font (12 pixels wide) it happens.

Also, it could be useful if anyone wants to go completely nuts and use small characters (e.g. 4x6) to generate individually coloured pixels (960x360 on UHD)

Hi Darthmite,
Chr$(0) thru Chr$(255) are all valid string character values. I just think of STRING type as a list of 8-bit bytes, [with a length byte (0-255) in front]...not necessarily used for Ascii purposes...the less restrictions, the more opportunities to create! (or go nuts )

Regards,
Phil


Edited by flip on 28 August 2017 at 11:07pm
Back to Top View flip's Profile Search for other posts by flip
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 340
Posted: 29 August 2017 at 1:47pm | IP Logged Quote CaptainBoing

flip wrote:

Chr$(0) thru Chr$(255) are all valid string character values. I just think of STRING type as a list of 8-bit bytes, [with a length byte (0-255) in front]...not necessarily used for Ascii purposes.


+1

__________________

all you need is duct tape and WD40 (if it moves and shouldn't, use duct tape; if it doesn't move and should, use WD40)
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 


<< Prev Page of 8 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1094 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.11