![]() |
Forum Index : Microcontroller and PC projects : MM-DOS: Is there really no DIR$ function or equivalent
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
Hi folks, I was idly poking at an MMBasic DOS version of Z-MIM when I came across an unexpected problem: Is there really no DIR$ function or equivalent for programatically iterating through the contents of a directory? Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
As far as I can tell, you'll need to use SYSTEM command-line$ in order to use actual DOS dir command. The example says it saves the results into a text file, which you could then operate on in mmbasic. |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
Thank you. I guess I could make that work, though it's a bit of a nuisance. I wonder how much trouble it would be to build MMBasic DOS myself and make some updates - the problem is I keep finding myself pulled in different directions by the 'mites. Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
MMBasic for dos/win certainly is limited compared to the 'mites by the looks of things. I can't fully test all the features of my current program i'm writing as I run out of memory lol. Plus, with no graphics options, there's a whole half of my program that can't work either. And finally, you can't include other files into your main program like you can on the CMM2 or others. It's fine for getting some logic up and running, making sure values are being manipulated properly and stuff, but man, I can't wait to actually get my CMM2 (still waiting for it to be dispatched... its on back order at MicroMite.org) so I can actually test all the things lol |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
That must be a big program, it looks like MM Basic for DOS has 0.5 MB for Program and 0.5 MB for Variables. I believe that only the CMM2 supports #INCLUDE, the CMM1 has support for LIBRARY, I'm not sure about the micromites as I don't think necessarily have file-systems you could include additional files from. My transcompiler (which I keep harping on about, but not delivering) can flatten #INCLUDE structures so that is how I'm converting the CMM2 source-code of Z-MIM to run on other platforms. I was lucky, I think I got the first CMM2 that the WhiteWizzard at MicroMite.org sold ... I hope he doesn't regret it, I'm proving to be rather noisy ![]() Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3358 |
In December, 2018, I found it trivially easy to compile mmbasic for DOS to add Peter Mather's longstring functions (for which he provided the source). I just downloaded the recommended openWatcom C compiler and ran the compilation for DOS for the downloaded mmbasic source on my 64-bit Win10 laptop. The BuildAll.bat file ran to completion in 16 seconds, and the mmbasic.exe executable works, at least as far as PRINT "Hello, World" goes. The longstring functions also worked. Edited 2020-07-07 23:33 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
And it is still trivially easy in July 2020 ![]() I was bracing myself for an extended period of swearing trying to set up the tooling but it all ran smoothly and built first time. On first flush it even looks like I maye be able to lift most of the implemenation of Dir$() from the Picromite source. Did you contact Geoff about including your port of LONGSTRING upstream ? It would have been helpful to me, but it's not essential. Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3358 |
I suggested it, but it hasn't been included (matherp's LONGSTRING code--I changed nothing about it). PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
thwill, is it possible to increase the amount of memory allocated for programs in mmbasic-dos/win source? I need about 3MB right now. 512K just isnt cutting it lol... Edited 2020-07-08 00:44 by Atomizer_Zero |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
I'm new here myself, but it's possibly just a case of changing the value of HEAP_SIZE in Configuration.h and recompiling. I'm afraid you will need to do that for yourself though as the license agreement that gives me (or anyone else who requests) access to the source code expressly excludes the rights to distribute modified code or binaries. And Geoff has understandable reasons for this: http://geoffg.net/OpenSource.html Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3358 |
Matherp sent made the longstring routines available in a link in the second page of this thread: longstring code I just downloaded them, so the link is still good. You just replace DOS_Misc.c and DOS_Misc.h and recompile. Edited 2020-07-08 00:52 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
Thank you, though they are actually no good to me in terms of supporting Z-MIM unless included in the official build. I've already contacted Geoff about the addition of DIR$() as he has generously agreed to take a look at my proposed code if/when I produce it. Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
Fair enough. Thanks for the information. I guess in the grand scheme of things, I can just wait for the cmm2 instead of modifying mmbasic dos source code. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |