summaryrefslogtreecommitdiffstats
path: root/doc/proc.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
commit45beb64f7dcb09a6ce83532702bca760f72e6f4d (patch)
treef7746a2a8316d612570e1456524e3d182e855c82 /doc/proc.n
parent5bc57d7b0f63d86fc383565d69f7704943fff94d (diff)
downloadtcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.zip
tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.gz
tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.bz2
Yet more doc update backporting
Diffstat (limited to 'doc/proc.n')
-rw-r--r--doc/proc.n22
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/proc.n b/doc/proc.n
index 6735ef0..031d3ea 100644
--- a/doc/proc.n
+++ b/doc/proc.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: proc.n,v 1.3 2000/09/07 14:27:50 poenitz Exp $
+'\" RCS: @(#) $Id: proc.n,v 1.3.18.1 2004/10/27 14:23:57 dkf Exp $
'\"
.so man.macros
.TH proc n "" Tcl "Tcl Built-In Commands"
@@ -69,6 +69,26 @@ invoked, the procedure's return value is the value specified in a
executed in the procedure's body.
If an error occurs while executing the procedure
body, then the procedure-as-a-whole will return that same error.
+.SH EXAMPLES
+This is a procedure that accepts arbitrarily many arguments and prints
+them out, one by one.
+.CS
+\fBproc\fR printArguments args {
+ foreach arg $args {
+ puts $arg
+ }
+}
+.CE
+.PP
+This procedure is a bit like the \fBincr\fR command, except it
+multiplies the contents of the named variable by the value, which
+defaults to \fB2\fR:
+.CS
+\fBproc\fR mult {varName {multiplier 2}} {
+ upvar 1 $varName var
+ set var [expr {$var * $multiplier}]
+}
+.CE
.SH "SEE ALSO"
info(n), unknown(n)