Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/unset.n @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 2.1 KB
Line 
1'\"
2'\" Copyright (c) 1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\" Copyright (c) 2000 Ajuba Solutions.
5'\"
6'\" See the file "license.terms" for information on usage and redistribution
7'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8'\"
9'\" RCS: @(#) $Id: unset.n,v 1.13 2007/12/13 15:22:33 dgp Exp $
10'\"
11.so man.macros
12.TH unset n 8.4 Tcl "Tcl Built-In Commands"
13.BS
14'\" Note:  do not modify the .SH NAME line immediately below!
15.SH NAME
16unset \- Delete variables
17.SH SYNOPSIS
18\fBunset \fR?\fI\-nocomplain\fR? ?\fI\-\-\fR? ?\fIname name name ...\fR?
19.BE
20.SH DESCRIPTION
21.PP
22This command removes one or more variables.
23Each \fIname\fR is a variable name, specified in any of the
24ways acceptable to the \fBset\fR command.
25If a \fIname\fR refers to an element of an array then that
26element is removed without affecting the rest of the array.
27If a \fIname\fR consists of an array name with no parenthesized
28index, then the entire array is deleted.
29The \fBunset\fR command returns an empty string as result.
30If \fI\-nocomplain\fR is specified as the first argument, any possible
31errors are suppressed.  The option may not be abbreviated, in order to
32disambiguate it from possible variable names.  The option \fI\-\-\fR
33indicates the end of the options, and should be used if you wish to
34remove a variable with the same name as any of the options.
35If an error occurs, any variables after the named one causing the error not
36deleted.  An error can occur when the named variable does not exist, or the
37name refers to an array element but the variable is a scalar, or the name
38refers to a variable in a non-existent namespace.
39.SH EXAMPLE
40Create an array containing a mapping from some numbers to their
41squares and remove the array elements for non-prime numbers:
42.CS
43array set squares {
44    1 1    6 36
45    2 4    7 49
46    3 9    8 64
47    4 16   9 81
48    5 25  10 100
49}
50
51puts "The squares are:"
52parray squares
53
54\fBunset\fR squares(1) squares(4) squares(6)
55\fBunset\fR squares(8) squares(9) squares(10)
56
57puts "The prime squares are:"
58parray squares
59.CE
60.SH "SEE ALSO"
61set(n), trace(n), upvar(n)
62.SH KEYWORDS
63remove, variable
Note: See TracBrowser for help on using the repository browser.