home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / doc / lrange.n < prev    next >
Text File  |  1993-05-03  |  2KB  |  52 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/lrange.n,v 1.1 93/05/03 17:34:07 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS lrange tcl
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. lrange \- Return one or more adjacent elements from a list
  29. .SH SYNOPSIS
  30. \fBlrange \fIlist first last
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. \fIList\fR must be a valid Tcl list.  This command will
  36. return a new list consisting of elements
  37. \fIfirst\fR through \fIlast\fR, inclusive.
  38. \fILast\fR may be \fBend\fR (or any
  39. abbreviation of it) to refer to the last element of the list.
  40. If \fIfirst\fR is less than zero, it is treated as if it were zero.
  41. If \fIlast\fR is greater than or equal to the number of elements
  42. in the list, then it is treated as if it were \fBend\fR.
  43. If \fIfirst\fR is greater than \fIlast\fR then an empty string
  44. is returned.
  45. Note: ``\fBlrange \fIlist first first\fR'' does not always produce the
  46. same result as ``\fBlindex \fIlist first\fR'' (although it often does
  47. for simple fields that aren't enclosed in braces); it does, however,
  48. produce exactly the same results as ``\fBlist [lindex \fIlist first\fB]\fR''
  49.  
  50. .SH KEYWORDS
  51. element, list, range, sublist
  52.