Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tcl_ListObjGetElements

Status
Not open for further replies.

mbitzko

Programmer
Apr 5, 2005
13
0
0
US
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
//---------------------------------



}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top