- Code/Resource
- Windows Develop
- Linux-Unix program
- Internet-Socket-Network
- Web Server
- Browser Client
- Ftp Server
- Ftp Client
- Browser Plugins
- Proxy Server
- Email Server
- Email Client
- WEB Mail
- Firewall-Security
- Telnet Server
- Telnet Client
- ICQ-IM-Chat
- Search Engine
- Sniffer Package capture
- Remote Control
- xml-soap-webservice
- P2P
- WEB(ASP,PHP,...)
- TCP/IP Stack
- SNMP
- Grid Computing
- SilverLight
- DNS
- Cluster Service
- Network Security
- Communication-Mobile
- Game Program
- Editor
- Multimedia program
- Graph program
- Compiler program
- Compress-Decompress algrithms
- Crypt_Decrypt algrithms
- Mathimatics-Numerical algorithms
- MultiLanguage
- Disk/Storage
- Java Develop
- assembly language
- Applications
- Other systems
- Database system
- Embeded-SCM Develop
- FlashMX/Flex
- source in ebook
- Delphi VCL
- OS Develop
- MiddleWare
- MPI
- MacOS develop
- LabView
- ELanguage
- Software/Tools
- E-Books
- Artical/Document
lrange.n
Package: ns-allinone-2.33.tar.gz [view]
Upload User: rrhhcc
Upload Date: 2015-12-11
Package Size: 54129k
Code Size: 2k
Category:
Communication
Development Platform:
Visual C++
- '"
- '" Copyright (c) 1993 The Regents of the University of California.
- '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
- '" Copyright (c) 2001 Kevin B. Kenny. All rights reserved.
- '"
- '" 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.4.1 2004/10/27 12:52:40 dkf Exp $
- '"
- .so man.macros
- .TH lrange n 7.4 Tcl "Tcl Built-In Commands"
- .BS
- '" Note: do not modify the .SH NAME line immediately below!
- .SH NAME
- lrange - Return one or more adjacent elements from a list
- .SH SYNOPSIS
- fBlrange fIlist first lastfR
- .BE
- .SH DESCRIPTION
- .PP
- fIListfR must be a valid Tcl list. This command will
- return a new list consisting of elements
- fIfirstfR through fIlastfR, inclusive.
- fIFirstfR or fIlastfR
- may be fBendfR (or any abbreviation of it) to refer to the last
- element of the list.
- If fIfirstfR is less than zero, it is treated as if it were zero.
- If fIlastfR is greater than or equal to the number of elements
- in the list, then it is treated as if it were fBendfR.
- If fIfirstfR is greater than fIlastfR then an empty string
- is returned.
- Note: ``fBlrange fIlist first firstfR'' does not always produce the
- same result as ``fBlindex fIlist firstfR'' (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 firstfB]fR''
- .SH EXAMPLES
- Selecting the first two elements:
- .CS
- % fBlrangefR {a b c d e} 0 1
- a b
- .CE
- .PP
- Selecting the last three elements:
- .CS
- % fBlrangefR {a b c d e} end-2 end
- c d e
- .CE
- .PP
- Selecting everything except the first and last element:
- .CS
- % fBlrangefR {a b c d e} 1 end-1
- b c d
- .CE
- .PP
- Selecting a single element with fBlrangefR is not the same as doing
- so with fBlindexfR:
- .CS
- % set var {some {elements to} select}
- some {elements to} select
- % lindex $var 1
- elements to
- % fBlrangefR $var 1 1
- {elements to}
- .CE
- .SH "SEE ALSO"
- .VS 8.4
- list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
- lset(n), lreplace(n), lsort(n)
- .VE
- .SH KEYWORDS
- element, list, range, sublist