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

Function Arguements Expected

Started by augustas656, 24 August 2013 - 02:07 PM
augustas656 #1
Posted 24 August 2013 - 04:07 PM
I got an error for function arguements expected.
I have a variable called oldPassword and I found the error when I typed print(oldPassword:len), I was testing print because of when I first found the error, I wanted to see if it's the oldPassword:len that was a causing the problem.

I need help to somehow fix it! :)/>
GopherAtl #2
Posted 24 August 2013 - 04:14 PM
len is a function. oldPassword:len().

to elaborate, ":" can only be used to call functions stored in tables, not just to access them, which is why it's complaining you don't have function args - () - after it. If you used "." instead, it would return the function itself, tho still not call it, and it would just print "function: <some hex value>"
augustas656 #3
Posted 24 August 2013 - 04:15 PM
Oh right, damn, I always use that, I forgot :D/>, I was so annoyed trying to find the error, oh well :D/>, lol