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

[Lua] Startup program with arguments

Started by W00dyR, 19 December 2012 - 05:13 AM
W00dyR #1
Posted 19 December 2012 - 06:13 AM
Hey guys,

I have a program that I want to run on startup, but the input requires an argument.

My script right now is


shell.run("disk/program1")

The program that I want executed requires an argument behind the "program1", and if possible even more arguments. How do I make it so that this happens in the shell.run ?

Thanks ahead!
Lyqyd #2
Posted 19 December 2012 - 06:40 AM
shell.run("path/to/program", "anArgument", "anotherArgument", "aThirdArgument", aVariableWhoseContentsAreBeingPassedAsAnArgumentIfItIsANumberOrAString)
W00dyR #3
Posted 19 December 2012 - 06:47 AM
shell.run("path/to/program", "anArgument", "anotherArgument", "aThirdArgument", aVariableWhoseContentsAreBeingPassedAsAnArgumentIfItIsANumberOrAString)

Thank you very much once again, so if it is a string or number no "s and if its a argument you use "s right?
Orwell #4
Posted 19 December 2012 - 06:56 AM
No, if it's a variable drop the "s, if it is a string use "s.
ChunLing #5
Posted 19 December 2012 - 12:56 PM
For a number you don't need the double quotes, but only if it is for sure used as a number and not as a string.