Returns the address of a stub routine (in processor's code) which when it is called redirects execution to a local CalcIt function.
This command is used to import API calls (exported functions in DLLs) that need an address of a function in user's code to be called by the API routine itself. Usually we refer to such user code routines as CALLBACKs and it is obvious why. Callbacks is a usual way to customize a general operation offered by a routine. Represents the "polymorphism" of "old times", before the emergence of Object Oriented Programming languages and their handy virtual methods.
For example a Callback routine handles the appearance and operation of every Window created under Windows operating system. Additionally Callbacks are used In many other situations, for example in sorting routines where the CallBack function handles the way the values in a list are compared and so makes the same sorting routine able to sort correctly lists with arbitrary kind of elements and sorting preferences.
Because CalcIt local functions cannot be passed directly to such API calls we need a redirection mechanism that bridges native code execution with CalcIt code execution.
So CALLBACK command creates a stub routine, in processor's code, which when it is called by any API routine, redirects the execution to a local CalcIt function, handling all the interfacing details. This way the user can handle Callbacks in CalcIt code.
The Local CalcIt function has always the same interface:
Only one parameter. This parameter of Buffer type is used to handle the parameters of the called callback routine. The Buffer type ID defined in the CALLBACK command is assumed in this Buffer parameter.