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

[Lua][Error]bios:337: [string "DynationOS"]:23: unexpected symbol

Started by Spongy141, 16 March 2013 - 01:54 PM
Spongy141 #1
Posted 16 March 2013 - 02:54 PM
Hello, as the title says, I got an error, (not going to re-type it), and it says something is wrong with line 14… I can't seem to figure it out, so can one of you "Pros" help me out?
link to my code http://pastebin.com/whd2cMHu

EDIT: My bad, I added the copy right after I started the topic, so its really at line 23 now… sorry
Pharap #2
Posted 16 March 2013 - 03:14 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
    [1] = { 36, 50, 15, 16, "Create Account" },
	    [2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.
Spongy141 #3
Posted 16 March 2013 - 03:18 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
	[1] = { 36, 50, 15, 16, "Create Account" },
		[2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.
Actually, (lol) I did do that at first, and it gave the exact same error…
Dlcruz129 #4
Posted 16 March 2013 - 03:30 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
    [1] = { 36, 50, 15, 16, "Create Account" },
	    [2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.

I believe you add the comma after each index.
Spongy141 #5
Posted 16 March 2013 - 03:39 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
	[1] = { 36, 50, 15, 16, "Create Account" },
		[2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.

I believe you add the comma after each index.
Yeah I thought that too, but thing is, what is the problem with it? Since I do get an error either way…
Pharap #6
Posted 16 March 2013 - 03:39 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
	[1] = { 36, 50, 15, 16, "Create Account" },
		[2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.

I believe you add the comma after each index.

Except the last one, because there are no more to come after it.
Spongy141 #7
Posted 16 March 2013 - 03:42 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
	[1] = { 36, 50, 15, 16, "Create Account" },
		[2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.

I believe you add the comma after each index.

Except the last one, because there are no more to come after it.
Lol not to be rude… but can one of you just help me with why its having the error, since it does already just do the error anyways the the comma or no comma.
Pharap #8
Posted 16 March 2013 - 03:44 PM
Yeah I thought that too, but thing is, what is the problem with it? Since I do get an error either way…

The exact same error?
Even with the last comma removed?
Dlcruz129 #9
Posted 16 March 2013 - 03:45 PM
Actually, the title error you gave says line 23, the string "DynationOS" thing is the program name

around line 23 you have this:

local tCoords = {
	[1] = { 36, 50, 15, 16, "Create Account" },
		[2] = { 2, 7, 15, 16, "Login" }, --this is line 23
  }

Your issue is the second comma, it implies that you're going to add another item to the table but you don't, you leave it blank, hence the error.

I believe you add the comma after each index.

Except the last one, because there are no more to come after it.

Nope, according to the examples of tables provided in the Lua PIL, ALL indexes end in a comma.
Kingdaro #10
Posted 16 March 2013 - 03:47 PM
Trailing commas are optional.

As for the problem at hand, I don't really see anything wrong with it. I even ran it and it worked fine.

…Well, I tried to register an account and I received "dynos-test:115: attempt to index ? (a nil value)", which is probably caused by me not having a DOS folder.
Spongy141 #11
Posted 16 March 2013 - 03:49 PM
*Face Palm* Sorry guys, I got the error cuz I was editing my cc emulator version, when I was trying to use it in reg minecraft, so the whole time nothing was wrong, I feel really stupid.
Pharap #12
Posted 16 March 2013 - 03:54 PM
Except the last one, because there are no more to come after it.

Nope, according to the examples of tables provided in the Lua PIL, ALL indexes end in a comma.

Either way works in CC apparently, though I'm certain a comma following a nonexistant entry used to error.

Trailing commas are optional.

As for the problem at hand, I don't really see anything wrong with it. I even ran it and it worked fine.

…Well, I tried to register an account and I received "dynos-test:115: attempt to index ? (a nil value)", which is probably caused by me not having a DOS folder.

Nice to have a voice of reason.


*Face Palm* Sorry guys, I got the error cuz I was editing my cc emulator version, when I was trying to use it in reg minecraft, so the whole time nothing was wrong, I feel really stupid.

Well that's 8 minutes of my life gone lol
At least it's sorted now, that's the main thing.
Kingdaro #13
Posted 16 March 2013 - 03:58 PM
I can only recall trailing commas being allowed in CC, because it always errored in Love2D. Maybe it's a Java thing.
Pharap #14
Posted 16 March 2013 - 04:01 PM
I can only recall trailing commas being allowed in CC, because it always errored in Love2D. Maybe it's a Java thing.
I wouldn't be surprised, Java can be quite picky at times lol