Jump to content




Edit: 132: attempt to call string

computer

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

#1 RedP1ggyBank

  • Members
  • 3 posts

Posted 25 November 2015 - 11:18 PM

I wrote a program for a turtle to craft different tools based on a touchscreen input from a monitor. I ran it after editing a few lines of code, and nothing happened. I then tried to edit it, but I received an error: "Error: 132: attempt to call string". I don't know why it's doing this. I checked my saves file and the program is still in there. What's going on?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 26 November 2015 - 12:00 AM

More likely than not, you defined a string with the same title as one of ComputerCraft's in-built functions. You likely also made it a global variable, meaning that it's remaining loaded in memory even when your script completes - it'll stay there until you reboot the computer, interfering with any other scripts that relied on the original function pointer.

If you can't figure it out, post your code.

#3 RedP1ggyBank

  • Members
  • 3 posts

Posted 26 November 2015 - 12:29 AM

I rebooted the computer and now I can edit the code. I also noticed that I named a variable 'type'. Could this be the problem?

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 26 November 2015 - 12:35 AM

Certainly could be.

#5 RedP1ggyBank

  • Members
  • 3 posts

Posted 26 November 2015 - 01:20 AM

I renamed the variable and defined it as local. It fixed the problem. Thanks a billion!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users