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

Syntax error help

Started by ClassicRockFan, 26 January 2014 - 10:34 PM
ClassicRockFan #1
Posted 26 January 2014 - 11:34 PM
Okay, I have absolutely no idea what I'm doing wrong here but I keep getting a syntax error on line 13 (where I define my first function). Can someone please help me? http://pastebin.com/A0S64tFF And yes, I know my code could be cleaned up a bit. Any help is appreciated. Thank you.
surferpup #2
Posted 26 January 2014 - 11:41 PM
I think you posted the wrong pastebin reference. Just post the code here. All you need to do to post code here is either use the code icon in the editor ( <> ) or type in the code keywords manually and paste the code in from your pastebin.

eg:

RightSqareBracket code LeftSquareBracket

<code here>

RightSqareBracket /code LeftSquareBracket

This will produce:


my code

I checked your pastebin link, and it is not a function definition. It is the line:


term.setBackgroundColor(colors.gray)
ClassicRockFan #3
Posted 26 January 2014 - 11:43 PM
Yeah, I went back after I posted this and realized I missed the = sign. Thanks
surferpup #4
Posted 26 January 2014 - 11:53 PM
Your first line is an error:


local desktopBackground(colors.white)

Here, you are defining a variable desktopBackground as if you are calling a function. You are getting the error on line 13 because that is when the error manifests.