23 posts
Posted 03 September 2012 - 03:31 PM
I want to write some apis that need to take a function as an argument to call later, I have looked for this but not found it.
1548 posts
Location
That dark shadow under your bed...
Posted 03 September 2012 - 03:46 PM
just pass the function name as an argument but omit the parenthesis at the end, when you add parenthesis then it is called so:
local function test()
print('me')
end
local function run(param1)
param1()
end
run(test)
23 posts
Posted 03 September 2012 - 04:28 PM
Thank you.
1548 posts
Location
That dark shadow under your bed...
Posted 04 September 2012 - 07:15 AM
no problem, what are you planning on using it for?
23 posts
Posted 04 September 2012 - 10:56 PM
My cc os.