![]() |
Forum Index : Microcontroller and PC projects : MMBasic for Windows - alphas
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Good morning Peter, Two bugs/inconsistencies, one request and one question this morning: 1. Bug 1: CMM2: > Print Mm.Info(FileSize "dir-that-exists") -2 > Print Mm.Info(FileSize "dir-that-exists/") Invalid file specification > Print Mm.Info(FileSize "dir-that-exists\") Invalid file specification > Print Mm.Info(FileSize "file-that-exists.txt") 6378 > Print Mm.Info(FileSize "file-that-does-not-exist.txt") -1 MMB4W: > Print Mm.Info(FileSize "dir-that-exists") 0 > Print Mm.Info(FileSize "dir-that-exists/") -1 > Print Mm.Info(FileSize "dir-that-exists\") -1 > Print Mm.Info(FileSize "file-that-exists.txt") 6378 > Print Mm.Info(FileSize "file-that-does-not-exist.txt") -1 Note that I don't care what the "answer" is, just that it is consistent across the CMM2, PicoMite, MMB4W and MMB4L ... well actually it will never be completely consistent for MMB4L since directories have a "size" (usually 4096) in Linux. 2. Bug 2: Run this on the CMM2 and MMB4W: Open "foo.txt" For Output As #1 Print #1, "Hello World" Print #1, "Goodbye World" Close #1 Open "foo.txt" For Input As #1 Print Eof(#1) s$ = Input$(255, #1) Print Eof(#1) Close #1 The output on the CMM2: 0 1 The output on MMB4W: 0 -1 I think the returned value for EOF should be 1 as MMBasic generally uses 1 for TRUE. 3. The request: Could we please have (on all platforms) a MM.INFO(EXISTS "foo") that returns 1 if "foo" exists and is a file OR a directory. 4. The question: Am I correct in thinking MMB4W allows more than 10 open files unlike the other ports, and if so how many? Best wishes, Tom Edited 2022-02-25 20:20 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Think they are all done including the request MMBasic.zip The question - not sure if there is a limit in windows but I've allowed for 64 com ports and 64 files Currently working on porting the socket support from Pi-Cromite. Have you included this in MMB4L? Edited 2022-02-25 20:42 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Thanks Peter, will give it a spin on Monday morning ... I want to grab a few hours this weekend to work on MMB4L. Not yet Peter and it isn't slated for the first non-alpha/beta release. I can't keep up with you and am not even trying I would however be grateful if I can cannibalise whatever you do for MMB4W. Best wishes, Tom Edited 2022-02-25 20:51 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
The Pi-Cromite code should work out of the box for you - I need to make changes for windows |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Thanks Peter, I had assumed as much but you never know. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3310 |
Picomite I/O serial client Posted yesterday. More to come. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 572 |
Hi matherp , today i have testet MMBasic4W on 16 win 10 Pc , most diffent hardware. Demox runs fine ! Btw its the only software i know which play modfiles without extra dll such like fmod. Edited 2022-02-25 23:59 by Plasmamac Plasma |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Demox runs fine ! Btw its the only software i know which play modfiles without extra dll such like fmod. ![]() ![]() ![]() |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
V5.07.03pa12 MMBasic.zip Fixes bug in F2 leaving the editor NEW FUNCTIONALITY TCP command as per Pi-Cromite GETIP$() function as per Pi-Cromite SYSTEM command as per Pi-Cromite JSON$ function Pi-cromite Manual.pdf This now allows you to do things like download the weather. You will need to substitute your own openweathermap.org APIKEY$ and a local PLACEID$ in the attached to make it work for you. Option explicit Option default none Dim a$,b$,c$ Dim integer i,j,rlen Dim m%(4000) Dim PLACEID$="2638878" Dim APIKEY$="myAPIkey" ' ' get the IP address of openweathermap and open a client connection to it ' a$="api.openweathermap.org" TCP client a$,80 ' ' construct the request for a weather report and send it ' b$= "GET /data/2.5/weather?id="+PLACEID$+"&APPID="+APIKEY$ b$=b$+" HTTP/1.0"+Chr$(13)+Chr$(10)+Chr$(13)+Chr$(10) TCP send b$ ' 'set up a longstring variable and read the return message into it ' LongString clear m%() Do TCP receive c$ If c$<>"" Then LongString append m%(),c$ Loop While c$<>"" ' ' trim off the HTTP header ' LongString trim m%(),LInStr(m%(),"{")-1 rlen=LLen(m%()) ' ' process the message, in this case just print it out ' i=1 Do While rlen>0 If rlen>240 Then j=240 Else j=rlen EndIf rlen=rlen-j Print LGetStr$(m%(),i,j); i=i+j Loop Print "" TCP close Print "Weather for "+json$(m%(),"name") Print "Temperature is ",val(json$(m%(),"main.temp"))-273 Print "Pressure is ",json$(m%(),"main.pressure") Print json$(m%(),"weather[0].description") Edited 2022-02-26 02:12 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Nice. FYI and take them or leave them I added a couple of extensions to JSON$ and SYSTEM for MMB4L, you can see more here: https://github.com/thwill1000/mmb4l-src/blob/main/linux-src/functions/fun_json.c https://github.com/thwill1000/mmb4l-src/blob/main/linux-src/commands/cmd_system.c Sorry folks the last two links are only accessible to collaborators on that GitHub project, however I've recently cleared it with Geoff and from alpha 4 MMB4L will be going open-source and that project will become public. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7505 |
Latest version of the doc. I tried to export as PDF again but the converter complained, so it's zipped RTF again. MMBasic For Windows 220225.zip Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3310 |
MMBasic For Windows 220225.zip Thanks for that. I just printed it to "Microsoft Print to PDF". MMBasic_For_Windows.pdf PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Forgot to mention in dispatches, mp3, flac and wav playback now support multiple sampling frequencies. FLAC tested up to 192k @ 24-bit |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 572 |
no picromite here so i have to ask : is it ok what a$= GETIP$("www.google.com") end will show the ip without print a$ ? Plasma |
||||
Goksteroo Senior Member ![]() Joined: 15/03/2021 Location: AustraliaPosts: 114 |
Issues with PAUSE... can be inaccurate with values <50, and very inaccurate with values <10 and let's not mention <1! This little test programme will show the issues better than I could describe them. Runs on CMM2 with results the same for using PAUSE or DO/LOOPs. Came about when I was using PAUSE to make a scrolling page smooth (no GETSCANLINE in MMB4W) and couldn't get consistency until I used the DO/LOOP approach. do cls td=0 tp=0 input "Delay wanted:";d for i=1 to 10 timer=0 do loop while timer<d t=timer inc td,t print "Do/Loop: ";d,t timer=0 pause d t=timer inc tp,t print "Pause: ";d,t next print "Do/Loop average: ";td/10 print "Pause average: ";tp/10 print:print "Press [SPACE]" do loop while inkey$<>" " loop |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6220 |
It is a known problem. Timer is very accurate but PAUSE and SETTICK not so good as you have seen. For long pauses, if critical, I suggest start with a pause a bit shorter than required then use timer in a loop to sneak up on the target time. For SETTICK, I found that cancelling the settick timer and re-starting it every time the tick fires gives a more consistent result. If you leave the SETTICK repeating, you can get a very short time interval. Hopefully, a resolution can be found soon. Multitasking operating systems make life difficult. Jim VK7JH MMedit |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
I think I can fix pause but settick will take a bit longer - watch this space Edited 2022-02-26 18:51 by matherp |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
V5.07.03a13 MMBasic.zip Rework of pause and settick Test program option milliseconds on settick 1000,myint timer=0 do pause 5000 print time$ loop sub myint static int lasttime=timer print timer-lasttime lasttime=timer end sub Edited 2022-02-26 20:20 by matherp |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
Hi matherp, Or maybe SQLite should be included? Then one could get DATA from text fields as with BASIC DATA with arguments separated by comma. Using simple SQL queries Michal Edited 2022-02-26 23:29 by Michal |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3310 |
For the last two mmb4w firmware updates, I am denied access to copy to a folder which is in my path. I'm the administrator--when I click to give administrator rights, still denied. I copied to a different folder, opened an "Administrator command line" (DOS with administrator rights) and tried to copy to the folder I wanted, but get this: C:\WINDOWS\system32>copy \dl\micromite\_mmb4w\mmbasic.exe \bin Access is denied. 0 file(s) copied. C:\WINDOWS\system32> What has changed (there has been a Win10 update on my laptop since this last succeeded), and what more can I do? (Who has more rights on my laptop than I as administrator do? ... grrr) PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |