Function _conEvalB() Foundation

Evaluates a code block.

Syntax
XPPAPIRET _conEvalB(ContainerHandle chres, ContainerHandle chb,
                    ULONG nParams, ...);
Parameters
ContainerHandle chres
Handle of a container into which the result of the code block is written.
ContainerHandle chb
Handle of the container holding the code block to execute.
ULONG nParams
Number of parameter containers to pass to the code block.
. . .
The remaining arguments must be of the container handle type and are passed as parameters to the code block. Note that since the arguments are containers, the parameters are passed by reference, not by value.
Return

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.

Description

Using this function any code block can be executed.

Examples
/* 
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); 
} 
} 

Feedback

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.