Reputation: 737
I have a function
function f1(msg) return value end
in Lua file A.lua, how i can call this function or the return result of this function from a B.lua Thank you Jp
Upvotes: 2
Views: 3442
Reputation: 827
As a complement to brianm, you can also
dofile("A.lua")
f1("blah")
or
local chunk = assert(loadfile("A.lua"))
chunk()
f1("blah")
Upvotes: 1
Reputation: 2045
You use the require function ( http://www.lua.org/pil/8.1.html )
require("A")
f1("my message")
Upvotes: 6