on init
declare kccn
end on
function cc_notify { invoke this from host's controller callback when using amode = 1 }
kccn := CC_NUM { latest CC that changed }
end function
on_cc_notify
macro on_cc_notify { create controller callback and invoke cc_notify }
on controller
cc_notify
end on
end macro
...But this doesn't:
on init
declare kccn
end on
on_cc_notify
function cc_notify { invoke this from host's controller callback when using amode = 1 }
kccn := CC_NUM { latest CC that changed }
end function
macro on_cc_notify { create controller callback and invoke cc_notify }
on controller
cc_notify
end on
end macro
The cc_notify function gets expanded within the on controller callback, which causes a syntax error
Compiled code:
on init
declare sksp_dummy
declare concat_it
declare concat_offset
declare string_it
declare list_it
declare preproc_i
declare kccn
end on
on controller
cc_notify
function cc_notify
kccn := CC_NUM
end function
end on
For example, this compiles:
...But this doesn't:
The
cc_notify
function gets expanded within theon controller
callback, which causes a syntax errorCompiled code: