Posted 06 February 2017 - 04:53 PM
Id wnat to call a table:func() function with a string. If I write test["func"]() I call test.func and not test:func().Has anybody a idea?
tab.func(self)
--# we defined self ourselves
end
--# is same as
tab:func()
--# self is implied as the first argument by the colon
end
--# calling these functions can be done like so
--# these work for both ways of defining the function above
tab.func(tab) --# pass tab manually
tab:func() --# again implied first argument as tab via colon
--# the one you seem to be interested in but working (or should be)
tab["func"](tab)