2 posts
Posted 20 July 2014 - 07:19 PM
Here is the code I am suing for the program:
http://pastebin.com/Rvtn6Bjwand the error I get is this:
bios:366: [string "Radio"]:7: '}' expected (to close '{' at line 3)
At first glance I thought I had forgotten a closing bracket or misplaced one, but the table started on line 3 is properly closed on line 10, so why is it saying I need a closing bracket on line 7?
7083 posts
Location
Tasmania (AU)
Posted 20 July 2014 - 08:14 PM
'cause you didn't stick a ; on line 6. It guesses you meant to put a } around that position instead.
34 posts
Posted 20 July 2014 - 08:17 PM
local button = {
buton_defaults = {
__index = {
color_bg = colors.gray;
color_cl = colors.red;
color_txt = colors.black
height = 3;
padding = 2;
isClicked = false;
};
};
Stop me If I am wrong but…
isClicked = false;
};
};
Shouldn't it be
isClicked = false;
}
}
? (And for all the others "}")
Edited on 20 July 2014 - 06:18 PM
7508 posts
Location
Australia
Posted 21 July 2014 - 01:45 AM
-telling to remove semicolons-
semi-colons are allowed as separators in tables and removing them would cause an error. As Bomb Bloke stated the problem is after
color_txt = colours.black
7083 posts
Location
Tasmania (AU)
Posted 21 July 2014 - 05:09 AM
Removing those particular ones wouldn't error, but it's not a problem to leave them in there, either.
7508 posts
Location
Australia
Posted 21 July 2014 - 05:21 AM
actually removing one of the two that Arektor suggested removing would cause an error. You could safely remove the one on line 10, but removing the one on line 11 would cause a problem due to the table declaration not being complete.
7083 posts
Location
Tasmania (AU)
Posted 21 July 2014 - 05:38 AM
True.
2 posts
Posted 22 July 2014 - 03:45 AM
I got my program working, thanks to Bomb for pointing out my obvious oversight, that wasn't the only missing semicolon either. Lesson learned about coding at 4am. And @Arketor, as was said, some of those semicolons being removed would cause errors, the others are there for personal OCD reasons. There are some other errors in this code, but I fixed it.