Posted 11 January 2015 - 05:14 PM
I'd like to know if it is possible to save what is printed in the screen in a var instead of the boolean returned
In the wiki:
For example:
Is there a way to put what would appear to the user in a variable? Something like this:
I mean, it's kinda 'easy' to do this with one specific command , but it would only work for "DIR" in this case, and i'm looking for something more complex, so it's possible to use any shell.run(command) and still get the RESULT instead of the RETURN.
Any hintzzz? ^_^/>
In the wiki:
shell.run()
Runs program with as many specified arguments as are provided.
Essentially takes all parameters passed to it and runs them as one line - for eg, shell.run("monitor","top","alongtimeago") is the same as shell.run("monitor top alongtimeago"), and you can use whichever syntax happens to suit you.
Returns boolean sucess
For example:
shell.run("dir")
Prints whatever is in the folderA = shell.run("dir")
Still prints the folder's content and A = booleanIs there a way to put what would appear to the user in a variable? Something like this:
A = shell.run("dir")
--Content of A:
A = {[1] = "rom", [2] = "program1",}
-- or maybe
A = "rom program1"
Also not printing what the command would printI mean, it's kinda 'easy' to do this with one specific command , but it would only work for "DIR" in this case, and i'm looking for something more complex, so it's possible to use any shell.run(command) and still get the RESULT instead of the RETURN.
Any hintzzz? ^_^/>