Multiline function tables in lua -
i cannot seem find other online creating table contains functions multiline. example, here snippit of code lua wiki.
action = { [1] = function (x) print(1) end, [2] = function (x) z = 5 end, ["nop"] = function (x) print(math.random()) end, ["my name"] = function (x) print("fred") end, }
i want this:
action = { [1] = function blah() more code here end [2] = function blahblah() more code here end }
so how can so?
action = { [1] = function (x) print(1) end, [2] = function (x) z = 5 end, ["nop"] = function (x) print(math.random()) end, ["my name"] = function (x) print("fred") end, }
you free that.
Comments
Post a Comment