This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MarioBG's profile picture

[Lua] Running a program inside another

Started by MarioBG, 31 December 2012 - 09:49 AM
MarioBG #1
Posted 31 December 2012 - 10:49 AM
Hello, I've recently embarked myself in a very ambitious project of making an OS, and for that I would need a way to have frames around the programs one runs. I have the intuition that it should be done with coroutines, but it would be the first time I used them. And obviously, one should still be able to interact with the OS and the desktop, along with the rest of the programs. I'm not looking for you to post all the code I need right here (although that would be awesome :lol:/> ), but rather orienting me to code sensibly. And, if any of you could and would team with me to develop this OS, please contact me! Thanks a lot to everyone!
remiX #2
Posted 31 December 2012 - 11:25 AM

shell.run("programName")

Will run another program within a program
MarioBG #3
Posted 31 December 2012 - 10:00 PM

shell.run("programName")

Will run another program within a program
But the first program won't be accessible if you use this, so it's not quite what I was looking for. I will still use it if there's no other option, but I would prefer the frame thing, like in real OSs.
ChunLing #4
Posted 31 December 2012 - 10:52 PM
Well, in real OS's, that basically requires that the software be specifically written for that OS (or be written for an OS that the running OS can run inside of a 'frame').

This is possible, but it's a pretty broad and deep topic.
nqeron #5
Posted 01 January 2013 - 08:28 AM
Functions, when done correctly, can be defined in a global scope. Given another query related to this, I may try to create a video on it.
ChunLing #6
Posted 01 January 2013 - 10:46 AM
Yes, an API would normally be necessary to implement a really good OS.