SDK Overview of Level 1
Level 1 functions are used for passing parameters between the 'C' functions and Recital. When creating a 'C' function with the API the parameters being passed should not be defined in the function name like a normal 'C' function. Instead the parameters passed are referenced with the API _par functions. Each parameter passed is referenced by specifying a number representing the ordinal position in the parameter list with the API _par function call.
For example, the following 'C' function is passed 2 parameters from Recital. The data type of each parameter is checked first with the _parinfo() function, then the value of the parameters are passed to a char with the _parc() function. Lastly the char value is then returned to Recital.
#include "dbapi.h" dbapi_test_function() { char string1[9]; char string2[9]; if (_parinfo(1) == API_CTYPE) { strcpy( string1, _parc(1)); } if (_parinfo(2) == API_CTYPE) { strcpy( string2, _parc(2)); } _retc( string1 ); }
Values are returned to Recital using the API _ret functions. Recital memory variables and array elements can also be updated from within the 'C' function to store the results, see level 3.