Has anyone have an example or know how to used a C++ interface call passing a list to the C++ procedure and iterating through the list.
==== TCL CODE =======
set myList {21 22 23}
testCmd $myList
===== C++ CODE =======
int testCmd( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) {
Tcl_Obj** listPtr;
if( Tcl_ListObjGetElements( interp, objv[1], &objc, &listPtr) != TCL_OK ) {
return TCL_ERROR;
}
//---------------------------------
// Iterate through the list here
//---------------------------------
}
==== TCL CODE =======
set myList {21 22 23}
testCmd $myList
===== C++ CODE =======
int testCmd( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ) {
Tcl_Obj** listPtr;
if( Tcl_ListObjGetElements( interp, objv[1], &objc, &listPtr) != TCL_OK ) {
return TCL_ERROR;
}
//---------------------------------
// Iterate through the list here
//---------------------------------
}