How do I code a program to start another program?
I don't know much code sorry
program opening programs?
Started by Thomas9666, May 22 2012 06:49 PM
10 replies to this topic
#1
Posted 22 May 2012 - 06:49 PM
#2
Posted 22 May 2012 - 07:06 PM
shell.run("programname", "argument1", "argument2"..)
#3
Posted 22 May 2012 - 07:07 PM
You can use shell.run("program", "arg1", "arg2", ...). Just don't use it to start your own program or just to run "clear" or something like that (you can, but it's not good to do it).
#5
Posted 22 May 2012 - 07:11 PM
thanks, I felt like an idiot asking there before and I thought that maybe other people had this problem and they would benefit from it being here... sorry
What are the arguments? What do they do?
What are the arguments? What do they do?
#6
Posted 22 May 2012 - 07:17 PM
Arguments are like when you type in the shell, for example, "edit test". "edit" would be the program name and "test" would be an argument. You can use them to make your program so it does different stuff depending on the arguments, or receive a file name so you don't have to ask for it later, etc.
#7
Posted 14 June 2012 - 08:51 AM
MysticT, on 22 May 2012 - 07:07 PM, said:
You can use shell.run("program", "arg1", "arg2", ...). Just don't use it to start your own program or just to run "clear" or something like that (you can, but it's not good to do it).
I currently have a few programs running progressions like:
-ultimate.program
--shell.run
---my.program
----shell.run
-----pre.programmed
so far, I've seen no problems, but are you implying that there can be? If so--what problems?
I did it this way 1) to keep the code short and clean 2) out of laziness...lol
#8
Posted 14 June 2012 - 12:23 PM
What they mean is don't run the same program that you are running from that program - otherwise you'll end up filling up the Lua stack - which has a depth limit of 256.
#9
Posted 14 June 2012 - 06:35 PM
Cloudy, on 14 June 2012 - 12:23 PM, said:
What they mean is don't run the same program that you are running from that program - otherwise you'll end up filling up the Lua stack - which has a depth limit of 256.
-my.program
--shell.run
---my.program
?
That seems kinda stupid to me anyway xD why not just run a loop?
The program I spoke of before I wrote to turn on/off outputs in RP2, and included higher programs to run multiples of these basic programs (faster than typing redset.... a million times).
#10
Posted 14 June 2012 - 07:14 PM
Precisely - it's stupid because there are loops purely for that reason
/>
#11
Posted 14 June 2012 - 09:37 PM
Cloudy, on 14 June 2012 - 07:14 PM, said:
Precisely - it's stupid because there are loops purely for that reason
/>
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











