can i run an existing command from BAS Progam?

17 views
Skip to first unread message

Magi Ancient

unread,
May 19, 2025, 5:42:46 PMMay 19
to MikeOS
I'm working on a set of startup routines using AUTORUN.BAS.
I want to run a seperate program and then, maybe conditionally, return...
kinda like background proc i guess...

Any way to call a program/command from within a BASIC file?

Magi Ancient

unread,
May 19, 2025, 5:46:20 PMMay 19
to MikeOS
for example:
```
rem *** program/command launcher test thingie ***
cls
myroutine:
    ink 3
    print "Starting the other program..."
    pause 30
    othprog1.bas
end

goto myroutine
end
```

Daniel Barry

unread,
May 20, 2025, 5:21:17 AMMay 20
to Magi Ancient, MikeOS
Hello Magi Ancient,

> kinda like background proc i guess...

MikeOS doesn't support multiple running processes to my knowledge. I did experiment with my own multitasking realtime OS years ago using a 'yield' function, it's a bit of a pain - there are better ways to do it.

>     othprog1.bas

It's worth checking out the documentation: https://mikeos.sourceforge.net/handbook-appdev-basic.html

Specifically the "include" keyword might be interesting to use:

> Appends another BASIC file onto the end of the current one, so that you can call routines in it. RAMSTART is updated accordingly.

You'll probably need to build out some kind of function structure on your subroutines so that you can send them data and get data back.

In your included files, just make sure that you have some kind of convention too, otherwise your subroutines will match, like:

    othprog1_init:

Kind Regards,

Dan

--
You received this message because you are subscribed to the Google Groups "MikeOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mikeos+un...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/mikeos/1134af62-ce64-4f87-a65a-9e7c4a09dd54n%40googlegroups.com.

Michael Saunders

unread,
May 20, 2025, 11:20:15 AMMay 20
to Magi Ancient, MikeOS
Hi Magi,

Dan Barry's answer is right. There's no way to do it as another BASIC
program would overwrite the current one, so there'd be nothing to
return to. Try the INCLUDE approach that he mentioned though!
> --
> You received this message because you are subscribed to the Google Groups "MikeOS" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mikeos+un...@googlegroups.com.
> To view this discussion, visit https://groups.google.com/d/msgid/mikeos/6369c2c3-74c2-47a0-be11-43507f2fa6a6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages