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

Can I activate a program when another ends (program stacking)?

Started by Than2000, 28 April 2014 - 09:31 PM
Than2000 #1
Posted 28 April 2014 - 11:31 PM
Hi, I'm new to computercraft and lua, but not new to programming. I am writing a program that's basically a desktop/file editor system, and I want it to be customizable. So, one of the main parts I want to add is editing icons. I right click on one, it opens a menu, and I can select Edit Icon. All that works. But what I need is, once I've edited the icon in paint, I need to run the desktop program again. Is there a way to run a program once you close another program or paint? I've looked all over, google, youtube, everything, even these forums. No one says anything about it. Is it possible? Is there an API that does that somewhere on the internet? i just want to know if I'm searching in vain. Thanks in advance!
MKlegoman357 #2
Posted 28 April 2014 - 11:44 PM
Just run the paint program without stopping your main program. For example:


--// main program's code here

if buttonPressed then --// random code to check if an edit button was pressed
  shell.run("paint", imageFilename) --// run the paint program
end

--// continue running the main program