![]() |
Forum Index : Microcontroller and PC projects : MMBASIC pass variables to a program
Author | Message | ||||
PCG68 Newbie ![]() Joined: 14/07/2018 Location: ItalyPosts: 16 |
Hello everyone. I wanted to ask if there is a possibility in mmbasic to pass variables or flags directly to a program at its launch. I try to explain myself better, but with my English it will be difficult. for example, given the program test.bas, is it possible to pass flags "load test -g" directly? If not, is the only system to create an external file to read after booting? Thank you all. |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
Ciao PCG Are you able to store them in a file on disk? ie. when test.bas starts, it looks for a file called test.cfg if found, it opens it and reads lines from the file - and this will be it's config data. Fred.bas could look for a fred.cfg and so on You'll probably need to have either some parsing method or go for a strictly formatted file where line1 is x and line 2 is y etc... |
||||
PCG68 Newbie ![]() Joined: 14/07/2018 Location: ItalyPosts: 16 |
Thanks for the reply CaptainBoing. Now I write the data in a text file on the SD that is read by the second program once launched and it works. I wanted to see if a better system existed and how You do in these cases. Possible to use switches like in the dos? (es.. deltree /Y). Thanks again. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
The original Maximites had MM.CMDLINE$ Just what you are looking for. Jim Edit I think it's still there in the DOS and Pi versions. Not so sure about the others. VK7JH MMedit |
||||
PCG68 Newbie ![]() Joined: 14/07/2018 Location: ItalyPosts: 16 |
Hello everyone. Thanks Jim. Yes MM.CMDLINE$ It's OK, but I think it was dropped in the micromite versions as well as the maximite merge file$. I confess I have not read all three manuals carefully, I will check better. Now I'm sketching the code with the mmbasic dos version, but it will have to run on the H7 arm I'm finishing. I have seen MM.PERSIST "Sets a user variable that will survive restarts and watchdog timeouts" so I think resident in flash, to be used sparingly. In short, it is the eternal dilemma of a new platform, what to keep and what to innovate .. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |