Jump to content




Unexpected symbol problem

help wireless computer

3 replies to this topic

#1 CastleMan2000

  • Members
  • 195 posts
  • LocationThe trashcan where all Undertale trash is

Posted 21 April 2014 - 07:18 PM

bios:366: [string "agps"]:17: unexpected symbol

I get this error when I try to run my program. It's designed to be a simple GPS locator. Along with this problem, I worry about the scope of my variables (i.e. if another part of the program won't be able to access a variable it needs), so any help with other general debugging in the program would be appreciated.

Pastebin link: http://pastebin.com/7dfJSWME

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 21 April 2014 - 07:23 PM

When setting table values (in this case, newHome[1] through 3), you don't use the local keyword. You only use the local keyword when declaring the table itself, if desired.

#3 Dayrider10

  • Members
  • 32 posts

Posted 21 April 2014 - 07:25 PM

You localized the table newHome in the first function. Since that is the case the table returns nil. I would suggest using table.insert in this case.

#4 CastleMan2000

  • Members
  • 195 posts
  • LocationThe trashcan where all Undertale trash is

Posted 21 April 2014 - 07:38 PM

Ah. Okay. I'll try that.

Alright, new problem. Line 49, attempted to get length of nil. I suspect this is due to the localization of homeLoc on line 30. How do I fix this? Am I wrong in the assumption (I think actually maybe from past experience) that non-local vars will "leak" into other programs (i.e. if you create variable "foo" in prog1, and prog2 calls the value of "foo", then prog2 gets the value of foo that was established in prog1, and vice versa for others)?

EDIT: Fixed it, nevermind.

Edited by CastleMan2000, 21 April 2014 - 08:04 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users