summaryrefslogtreecommitdiffstats
path: root/doc/lrange.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 12:52:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 12:52:31 (GMT)
commit5bc57d7b0f63d86fc383565d69f7704943fff94d (patch)
tree3ed6ba33b7a0eb1bb7d89c83f86bb2f420d5284a /doc/lrange.n
parent7ea5d4dbe8b82a86701cec95132a8a9557a5f105 (diff)
downloadtcl-5bc57d7b0f63d86fc383565d69f7704943fff94d.zip
tcl-5bc57d7b0f63d86fc383565d69f7704943fff94d.tar.gz
tcl-5bc57d7b0f63d86fc383565d69f7704943fff94d.tar.bz2
More doc fix backporting
Diffstat (limited to 'doc/lrange.n')
-rw-r--r--doc/lrange.n31
1 files changed, 30 insertions, 1 deletions
diff --git a/doc/lrange.n b/doc/lrange.n
index bafc0a2..9274f35 100644
--- a/doc/lrange.n
+++ b/doc/lrange.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: lrange.n,v 1.6 2001/11/14 23:38:39 hobbs Exp $
+'\" RCS: @(#) $Id: lrange.n,v 1.6.4.1 2004/10/27 12:52:40 dkf Exp $
'\"
.so man.macros
.TH lrange n 7.4 Tcl "Tcl Built-In Commands"
@@ -35,6 +35,35 @@ Note: ``\fBlrange \fIlist first first\fR'' does not always produce the
same result as ``\fBlindex \fIlist first\fR'' (although it often does
for simple fields that aren't enclosed in braces); it does, however,
produce exactly the same results as ``\fBlist [lindex \fIlist first\fB]\fR''
+.SH EXAMPLES
+Selecting the first two elements:
+.CS
+% \fBlrange\fR {a b c d e} 0 1
+a b
+.CE
+.PP
+Selecting the last three elements:
+.CS
+% \fBlrange\fR {a b c d e} end-2 end
+c d e
+.CE
+.PP
+Selecting everything except the first and last element:
+.CS
+% \fBlrange\fR {a b c d e} 1 end-1
+b c d
+.CE
+.PP
+Selecting a single element with \fBlrange\fR is not the same as doing
+so with \fBlindex\fR:
+.CS
+% set var {some {elements to} select}
+some {elements to} select
+% lindex $var 1
+elements to
+% \fBlrange\fR $var 1 1
+{elements to}
+.CE
.SH "SEE ALSO"
.VS 8.4