Jump to content




What is wrong with this?


  • You cannot reply to this topic
3 replies to this topic

#1 Lockandload1996

  • New Members
  • 1 posts

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

#2 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

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.

#3 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 08 February 2013 - 07:08 PM

View Postxuma202, on 08 February 2013 - 01:08 PM, said:

Also lua is case-sensitive print,local and term start should not start with capital letters.

I think he re-typed it.

#4 ChunLing

  • Members
  • 2,027 posts

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users