diff options
author | rjohnson <rjohnson> | 1998-03-26 14:45:59 (GMT) |
---|---|---|
committer | rjohnson <rjohnson> | 1998-03-26 14:45:59 (GMT) |
commit | 2b5738da524e944cda39e24c0a87b745a43bd8c3 (patch) | |
tree | 6e8c9473978f6dab66c601e911721a7bd9d70b1b /doc/set.n | |
parent | c6a259aeeca4814a97cf6694814c63e74e4e18fa (diff) | |
download | tcl-2b5738da524e944cda39e24c0a87b745a43bd8c3.zip tcl-2b5738da524e944cda39e24c0a87b745a43bd8c3.tar.gz tcl-2b5738da524e944cda39e24c0a87b745a43bd8c3.tar.bz2 |
Initial revision
Diffstat (limited to 'doc/set.n')
-rw-r--r-- | doc/set.n | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/set.n b/doc/set.n new file mode 100644 index 0000000..caf6cc2 --- /dev/null +++ b/doc/set.n @@ -0,0 +1,48 @@ +'\" +'\" Copyright (c) 1993 The Regents of the University of California. +'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" SCCS: @(#) set.n 1.6 97/05/18 15:56:26 +'\" +.so man.macros +.TH set n "" Tcl "Tcl Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +set \- Read and write variables +.SH SYNOPSIS +\fBset \fIvarName \fR?\fIvalue\fR? +.BE + +.SH DESCRIPTION +.PP +Returns the value of variable \fIvarName\fR. +If \fIvalue\fR is specified, then set +the value of \fIvarName\fR to \fIvalue\fR, creating a new variable +if one doesn't already exist, and return its value. +If \fIvarName\fR contains an open parenthesis and ends with a +close parenthesis, then it refers to an array element: the characters +before the first open parenthesis are the name of the array, +and the characters between the parentheses are the index within the array. +Otherwise \fIvarName\fR refers to a scalar variable. +Normally, \fIvarName\fR is unqualified +(does not include the names of any containing namespaces), +and the variable of that name in the current namespace is read or written. +If \fIvarName\fR includes namespace qualifiers +(in the array name if it refers to an array element), +the variable in the specified namespace is read or written. +.PP +If no procedure is active, +then \fIvarName\fR refers to a namespace variable +(global variable if the current namespace is the global namespace). +If a procedure is active, then \fIvarName\fR refers to a parameter +or local variable of the procedure unless the \fBglobal\fR command +was invoked to declare \fIvarName\fR to be global, +or unless a \fBvariable\fR command +was invoked to declare \fIvarName\fR to be a namespace variable. + +.SH KEYWORDS +read, write, variable |