Function _conEvalB() Foundation
Evaluates a code block.
XPPAPIRET _conEvalB(ContainerHandle chres, ContainerHandle chb,
ULONG nParams, ...);
Returns NULL when the code block was called successfully. Otherwise an error value is returned (XPP_ERR_...). If errors occur during execution of the code block, the error code block is called. Note: If the error code block causes a BREAK, the return value of _conEvalB() is XPP_ERR_BREAK. If the error can be rectified by the error code block, the return value is NULL.
Using this function any code block can be executed.
/*
Executes a code block passed as a parameter, passing it a single
argument.
*/
#include <xppcon.h>
XPPAPIRET xr;
ContainerHandle chCodeblock, chResult, chx;
/*
Reads Parameter 1
*/
chCodeblock = _conParam(<pList>, 1, NULL);
if (chCodeblock != NULLCONTAINER)
{
/*
Creates containers for the call
*/
chResult = _conNew(NULLCONTAINER);
chx = _conPutC(NULLCONTAINER, "Argument for the code block");
if (chResult != NULLCONTAINER && chx != NULLCONTAINER)
{
/*
attempt to evaluate the code block ...
*/
xr = _conEvalB(chResult, chCodeblock, 1, chx);
if (xr == 0)
{
/* Evaluates the result of the code block ... */
}
else
{
/*
error handling ...
(Parameter possibly not a code block?)
*/
}
_conRelease(chResult);
_conRelease(chx);
}
}
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.