Hi,
I'm currently getting the error, ":7: ')' expected"
Normally with this error I would do the obvious, find the missing closed parenthesis. From my multiple revisions I cannot find a missing one.
I'm looking to write a program that basically sends and receives from a turtle that will tell that turtle to run a selection of predefined functions within the turtle that will build and cleanup things.
I'm aware this is likely poorly written code for what I'm trying to do, but it's more for my own learning.
I'm relatively new to ComputerCraft/Lua and am sure I'm missing something relatively obvious so please bear with me as I bumble my way through the syntax.
http://pastebin.com/CRD2kgS0
Thanks in advance!
:7: ')' expected
Started by Sucon, Aug 31 2016 07:56 AM
3 replies to this topic
#1
Posted 31 August 2016 - 07:56 AM
#2
Posted 31 August 2016 - 09:31 AM
When putting " in a string bear in mind lua thinks thats the end of it. So to freely use " in a string put a \ before it 
Print("Im "Happy"") -> ) expected
Print("Im \"Happy\"") -> Im "Happy"
Print("Im "Happy"") -> ) expected
Print("Im \"Happy\"") -> Im "Happy"
#3
Posted 31 August 2016 - 09:33 AM
Line seven reads:
You've got the word "continue" sitting where the interpreter is expecting the bracket.
One way around this is to use mis-matching quote symbols, eg:
Another is to use escape characters to indicate that you intend certain quotes to be part of the one string:
print("Type "continue" in order to begin cleanup")
You've got the word "continue" sitting where the interpreter is expecting the bracket.
One way around this is to use mis-matching quote symbols, eg:
print('Type "continue" in order to begin cleanup')
Another is to use escape characters to indicate that you intend certain quotes to be part of the one string:
print("Type \"continue\" in order to begin cleanup")
#4
Posted 31 August 2016 - 11:24 PM
Silly me.
Works perfectly.
Thank you both very much!
Works perfectly.
Thank you both very much!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











