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

Coding help

Started by avatar5284, 07 August 2012 - 01:28 AM
avatar5284 #1
Posted 07 August 2012 - 03:28 AM
I am trying to do a very simple code but i keep getting an error when i run the program.
[attachment=370:2012-08-06_21-16-35.png] < this is the error
[attachment=371:2012-08-06_21-17-09.png] < this is the code
Zalerinian #2
Posted 07 August 2012 - 04:42 AM
On line three, print has a captial 'p'. Lua is case sensitive, and it must be a lowercase 'p'.
avatar5284 #3
Posted 07 August 2012 - 04:47 AM
Oh oops I over looked that ha I'll remember next time I get an error like this.
Zalerinian #4
Posted 07 August 2012 - 04:48 AM
Oh oops I over looked that ha I'll remember next time I get an error like this.

Its alright, its a common error.
avatar5284 #5
Posted 07 August 2012 - 05:03 AM
Is there a way after this program runs that it opens up another program automatically?
Bobder22 #6
Posted 07 August 2012 - 05:20 AM
I beleive it is something along the lines of shellrun("Program") But I am not quite sure. If you use the command help shellapi, it should be in there somewhere.
avatar5284 #7
Posted 07 August 2012 - 05:24 AM
I beleive it is something along the lines of shellrun("Program") But I am not quite sure. If you use the command help shellapi, it should be in there somewhere.

Sweet thanks I'll have to give it a try
ImNutzForCoal #8
Posted 07 August 2012 - 12:22 PM
os.run({}, "progamname")

is what I would find sufficient enough

if its on another drive/dir, then

"dir/prog" would work
Luanub #9
Posted 07 August 2012 - 01:15 PM
os.run() is good if you have extra args that you would like to pass to the program. Otherwise it's easier to just use shell.run(). Just make sure that you don't nest a program within itself.
avatar5284 #10
Posted 07 August 2012 - 03:42 PM
os.run() is good if you have extra args that you would like to pass to the program. Otherwise it's easier to just use shell.run(). Just make sure that you don't nest a program within itself.

Thanks shell.run() worked for what i'm doing!