diff options
Diffstat (limited to 'doc/ListObj.3')
-rw-r--r-- | doc/ListObj.3 | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/doc/ListObj.3 b/doc/ListObj.3 index a17ab66..4e0ae12 100644 --- a/doc/ListObj.3 +++ b/doc/ListObj.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ListObj.3,v 1.10 2005/05/10 18:33:56 kennykb Exp $ +'\" RCS: @(#) $Id: ListObj.3,v 1.11 2007/07/04 15:24:45 dkf Exp $ '\" .so man.macros .TH Tcl_ListObj 3 8.0 Tcl "Tcl Library Procedures" @@ -220,27 +220,33 @@ it can be used to implement a number of list operations. For example, the following code inserts the \fIobjc\fR objects referenced by the array of object pointers \fIobjv\fR just before the element \fIindex\fR of the list referenced by \fIlistPtr\fR: +.PP .CS -result = Tcl_ListObjReplace(interp, listPtr, index, 0, objc, objv); +result = Tcl_ListObjReplace(interp, listPtr, index, 0, + objc, objv); .CE +.PP Similarly, the following code appends the \fIobjc\fR objects referenced by the array \fIobjv\fR to the end of the list \fIlistPtr\fR: +.PP .CS result = Tcl_ListObjLength(interp, listPtr, &length); if (result == TCL_OK) { - result = Tcl_ListObjReplace(interp, listPtr, length, 0, objc, objv); + result = Tcl_ListObjReplace(interp, listPtr, length, 0, + objc, objv); } .CE +.PP The \fIcount\fR list elements starting at \fIfirst\fR can be deleted by simply calling \fBTcl_ListObjReplace\fR with a NULL \fIobjvPtr\fR: +.PP .CS -result = Tcl_ListObjReplace(interp, listPtr, first, count, 0, NULL); +result = Tcl_ListObjReplace(interp, listPtr, first, count, + 0, NULL); .CE - .SH "SEE ALSO" Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult - .SH KEYWORDS append, index, insert, internal representation, length, list, list object, list type, object, object type, replace, string representation |