Jump to content




i need help with error--attempt to call table--


  • You cannot reply to this topic
8 replies to this topic

#1 roosterhat

  • Members
  • 25 posts

Posted 19 September 2012 - 03:30 AM

Ive made program that is a lock for a door but stores the user info in fs. my program runs fine, but when ever i try to add a new user a second time it tells me that a write statement is trying to call a table

#2 BigSHinyToys

  • Members
  • 1,001 posts

Posted 19 September 2012 - 03:44 AM

shore I can fix that just let me telepathically copy your code ... no wait I'm not psychic please post your code.

#3 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 19 September 2012 - 03:53 PM

I agree with BigShinyToys. We need to see your code to find the error. We can't help without some knowledge of what you have.

#4 roosterhat

  • Members
  • 25 posts

Posted 19 September 2012 - 11:20 PM

do you want to see my full code or the part that i think is creating the error?

#5 roosterhat

  • Members
  • 25 posts

Posted 19 September 2012 - 11:24 PM

heres my full code
Spoiler


#6 roosterhat

  • Members
  • 25 posts

Posted 19 September 2012 - 11:26 PM

i think that part that is causing the bug is the function "add"

#7 roosterhat

  • Members
  • 25 posts

Posted 19 September 2012 - 11:30 PM

the error usually comes up at line 228 //write(":> ")//

#8 Fatal_Exception

  • New Members
  • 105 posts

Posted 20 September 2012 - 10:27 AM

You're doing this:

  write = fs.open("userinfo/"..username , "w")
  write.writeLine(password)

which is overriding write() with your file handle, so when you later do:

  write(":> ")

... you're accessing the table write (your file handle), and trying to call it as a function.

#9 roosterhat

  • Members
  • 25 posts

Posted 20 September 2012 - 09:30 PM

oh ok thank you





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users