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

How to load functions?

Started by thegreatstudio, 01 May 2013 - 07:47 AM
thegreatstudio #1
Posted 01 May 2013 - 09:47 AM
How to load functions like this code:

function sayHi()
print("Hi")
end

– function load code??
MR_nesquick #2
Posted 01 May 2013 - 09:56 AM
you call the function by it's name. in you're case it's sayHi()
thegreatstudio #3
Posted 01 May 2013 - 09:58 AM
how about many functions??
MR_nesquick #4
Posted 01 May 2013 - 10:02 AM
Try to read it up on CC wiki http://computercraft.info/wiki/Function_(type) ;)/>
Bubba #5
Posted 01 May 2013 - 10:02 AM
how about many functions??


local function one()
  print("Function 1")
end

local function two()
  print("Function 2")
end

one()
two()