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

Edit: 132: attempt to call string

Started by RedP1ggyBank, 25 November 2015 - 10:18 PM
RedP1ggyBank #1
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?
Bomb Bloke #2
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.
RedP1ggyBank #3
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?
Bomb Bloke #4
Posted 26 November 2015 - 12:35 AM
Certainly could be.
RedP1ggyBank #5
Posted 26 November 2015 - 01:20 AM
I renamed the variable and defined it as local. It fixed the problem. Thanks a billion!