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

attemp to call string?

Started by H4X0RZ, 27 June 2013 - 07:00 AM
H4X0RZ #1
Posted 27 June 2013 - 09:00 AM
Hello folks,
I'm working on a command line program (Like CraftOS) and have a global function called getProgramDir.
Now I want to use this function in a program of me but always get a "attempt to call string error".

The function only returns a string…
CoderPuppy #2
Posted 27 June 2013 - 09:15 AM
I can't help without code and error.
apemanzilla #3
Posted 27 June 2013 - 10:17 AM
Without seeing the actual code, it's rather hard to help… Are you sure you're not setting getProgramDir to a string anywhere? Also, are you calling it as getProgramDir or getProgramDir() ?
salt #4
Posted 27 June 2013 - 10:20 AM
try print(getProgramDir) … getProgramDir without ()
H4X0RZ #5
Posted 27 June 2013 - 10:42 AM
Yea, It was a mistake with the name :)/>
thanks for your help!
theoriginalbit #6
Posted 01 July 2013 - 07:15 AM
Yea, It was a mistake with the name :)/>
thanks for your help!
Try and remember…. When you get the "attempt to call" error that means that you're calling a function, that actually isn't a function, it is actually of the type the error contains. So check for any variables of that name where you are overwriting the function.