2. CALLBACKS 2.1. General Information • A callback is a section within a script that is being "called" (i.e. executed) at certain times.
• All callbacks start with on
and end with
end on
.
• Callbacks can be stopped by using the command exit.
• Each callback has a unique ID number which can be retrieved with
$NI_CALLBACK_ID
• You can query which callback triggered a function with
$NI_CALLBACK_TYPE
and the corre-
sponding built-in constants.
Examples function show_callback_type
if ($NI_CALLBACK_TYPE = $NI_CB_TYPE_NOTE)
message("Function was called from note callback!")
end if
if ($NI_CALLBACK_TYPE = $NI_CB_TYPE_CONTROLLER)
message("Function was called from controller callback!")
end if
end function
on note
call show_callback_type
end on
on controller
call show_callback_type
end on
Query the callback type in a function See Also exit
$NI_CALLBACK_ID
$NI_CALLBACK_TYPE