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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -