Lua: Function Table

I am trying to store different functions in a table, but for some reason this will not work as I thought. Here is my "code"

fn_table = { aFun1=print, aFun2=self:getSpeedLevel, aFun3=.... }

Now the problem is that I can do this with built-in functions such as print, assertand so on, but it will not work with other functions that I have.

I get an error: "... function arguments expected around '}'

Is it possible to save this function?

+3
source share
1 answer

aFun2 = self:getSpeedLevel , , Lua. aFun2 = getSpeedLevel aFun2 = self.getSpeedLevel (, self - ). Object-Oriented Programming PiL , .

+5

All Articles