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

What is wrong with this?

Started by Lockandload1996, 08 February 2013 - 11:27 AM
Lockandload1996 #1
Posted 08 February 2013 - 12:27 PM
Title: What is wrong with this?

I have this bit of code:
Print("which direction?")
Local direction = read()
Print("how many times?")
Local times = read()

Term.write("moving"..direction ..times "times")

And it just says:
Move:6: attempt to call string
xuma202 #2
Posted 08 February 2013 - 01:08 PM
You're missing the two dots in line 6 between times and "times"

Term.write("moving"..direction ..times.."times")
Also lua is case-sensitive print,local and term start should not start with capital letters.
remiX #3
Posted 08 February 2013 - 07:08 PM
Also lua is case-sensitive print,local and term start should not start with capital letters.

I think he re-typed it.
ChunLing #4
Posted 08 February 2013 - 08:08 PM
Yeah, cause it would have been an attempt to call nil error on the first line otherwise. So, a reminder, post your exact code inside of a code box (by typing [CODE][/CODE] around it or by hitting that little button that looks like a blue <> above the post input), so that we can actually distinguish the error from your various typos and such.

Longer programs should be on pastebin.