RE: setEvent, 'run' and passing parameters to macro?
2021-09-25, 20:10 (This post was last modified: 2021-09-25, 20:11 by Roland Melkert.)
2021-09-25, 20:10 (This post was last modified: 2021-09-25, 20:11 by Roland Melkert.)
(2021-09-25, 1:45)David Manley Wrote: can a value be passed via the setEvent API
Side note:
I have been thinking about adding a single extra optional parameter to all the setEvent functions.
But it will be a table name so you could have something like:
Code:
test={
doInit=true,
init=function(self)
print('init')
self.doInit=false
end,
run=function(self)
if self.doInit then
self:init()
end
print('work')
end
}
function register()
local macro=ldc.macro('test')
macro:setEvent('run', 'run', 'test')
end
register()
To fake object oriented programming.