Returning an array from C procedure
From: jacus (jniezgoda_at_kredytbank.pl)
Date: 02/27/04
- Next message: Andreas Leitgeb: "Re: Use "foreach i [range ...], not "for"?"
- Previous message: Bernhard Wallner: "Re: ANNOUNCE: freeWrap 5.6 released"
- Next in thread: Benjamin Riefenstahl: "Re: Returning an array from C procedure"
- Reply: Benjamin Riefenstahl: "Re: Returning an array from C procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Feb 2004 06:25:29 -0800
How can I create Tcl array in C procedure,
and how to create this array to Tcl script.
I tried to use Tcl_ObjSetVar2(interp, part1Ptr, part2Ptr, newValuePtr, flags)
but I do not know how to create Tcl_Obj *part1Ptr as Tcl array.
I tried like this:
Tcl_Obj *array = Tcl_NewObj();
Tcl_Obj *index = Tcl_NewStringObj("index_name", -1);
Tcl_Obj *value = Tcl_NewStringObj("element_value", -1);
Tcl_ObjSetVar2(interp, array, index, value, TCL_LEAVE_ERR_MSG);
Tcl_SetObjResult(interp, array);
return TCL_OK;
But it does not work. Any suggestions?
- Next message: Andreas Leitgeb: "Re: Use "foreach i [range ...], not "for"?"
- Previous message: Bernhard Wallner: "Re: ANNOUNCE: freeWrap 5.6 released"
- Next in thread: Benjamin Riefenstahl: "Re: Returning an array from C procedure"
- Reply: Benjamin Riefenstahl: "Re: Returning an array from C procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|