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

Attempt to call nil

Started by Mackan90096, 28 August 2014 - 03:42 PM
Mackan90096 #1
Posted 28 August 2014 - 05:42 PM
Hi, I'm making an os. I got error at line 91: attempt to call nil.
I can't for the love of god not find the error.
the code can be found here

Thanks for help.
Dragon53535 #2
Posted 28 August 2014 - 06:00 PM
your function main is defined after its trying to be called, try moving the offending function below it
Mackan90096 #3
Posted 28 August 2014 - 06:14 PM
But, that makes no difference in lua though…
TheOddByte #4
Posted 28 August 2014 - 06:18 PM
But, that makes no difference in lua though…
Yes it does

foo() -- #Attempt to call nil
local function foo()
    print( "bar" )
end
Mackan90096 #5
Posted 28 August 2014 - 06:42 PM
Spoiler
But, that makes no difference in lua though…
Yes it does

foo() -- #Attempt to call nil
local function foo()
	print( "bar" )
end
oh, I didn't know that. I'll try it.

Edit: It worked!
Edited on 28 August 2014 - 04:49 PM