summaryrefslogtreecommitdiffstats
path: root/doc/set.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/set.n')
-rw-r--r--doc/set.n11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/set.n b/doc/set.n
index 5e13713..f065087 100644
--- a/doc/set.n
+++ b/doc/set.n
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
+'\"
.TH set n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
@@ -29,27 +29,31 @@ Otherwise \fIvarName\fR refers to a scalar variable.
If \fIvarName\fR includes namespace qualifiers
(in the array name if it refers to an array element), or if \fIvarName\fR
is unqualified (does not include the names of any containing namespaces)
-but no procedure is active,
+but no procedure is active,
\fIvarName\fR refers to a namespace variable
resolved according to the rules described under \fBNAME RESOLUTION\fR in
the \fBnamespace\fR manual page.
.PP
If a procedure is active and \fIvarName\fR is unqualified, then
\fIvarName\fR refers to a parameter or local variable of the procedure,
-unless \fIvarName\fR was declared to resolve differently through one of the
+unless \fIvarName\fR was declared to resolve differently through one of the
\fBglobal\fR, \fBvariable\fR or \fBupvar\fR commands.
.SH EXAMPLES
+.PP
Store a random number in the variable \fIr\fR:
+.PP
.CS
\fBset\fR r [expr {rand()}]
.CE
.PP
Store a short message in an array element:
+.PP
.CS
\fBset\fR anAry(msg) "Hello, World!"
.CE
.PP
Store a short message in an array element specified by a variable:
+.PP
.CS
\fBset\fR elemName "msg"
\fBset\fR anAry($elemName) "Hello, World!"
@@ -58,6 +62,7 @@ Store a short message in an array element specified by a variable:
Copy a value into the variable \fIout\fR from a variable whose name is
stored in the \fIvbl\fR (note that it is often easier to use arrays in
practice instead of doing double-dereferencing):
+.PP
.CS
\fBset\fR in0 "small random"
\fBset\fR in1 "large random"