Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:20 01 Aug 2025 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 pass variables to a program

Author Message
PCG68
Newbie

Joined: 14/07/2018
Location: Italy
Posts: 16
Posted: 07:41am 13 Feb 2019
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 2170
Posted: 03:42pm 13 Feb 2019
Copy link to clipboard 
Print this post

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: Italy
Posts: 16
Posted: 05:08pm 13 Feb 2019
Copy link to clipboard 
Print this post



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: Australia
Posts: 6283
Posted: 09:01pm 13 Feb 2019
Copy link to clipboard 
Print this post

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.Edited by TassyJim 2019-02-15
VK7JH
MMedit
 
PCG68
Newbie

Joined: 14/07/2018
Location: Italy
Posts: 16
Posted: 08:26pm 14 Feb 2019
Copy link to clipboard 
Print this post

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 ..
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025