diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2004-10-27 14:43:09 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2004-10-27 14:43:09 (GMT) |
| commit | b9ebc9e90f360e1b0a61da51ca90ceb7390ea3ad (patch) | |
| tree | 7a733c8f49dc66ae55cca35e7652f5bb0b1c51c6 /doc/while.n | |
| parent | ca7836a09099892cfe6532eacdbb7f33cbaf1abf (diff) | |
| download | tcl-b9ebc9e90f360e1b0a61da51ca90ceb7390ea3ad.zip tcl-b9ebc9e90f360e1b0a61da51ca90ceb7390ea3ad.tar.gz tcl-b9ebc9e90f360e1b0a61da51ca90ceb7390ea3ad.tar.bz2 | |
Finished user-level documentation backport
Diffstat (limited to 'doc/while.n')
| -rw-r--r-- | doc/while.n | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/doc/while.n b/doc/while.n index ba5a584..dcaf8fc 100644 --- a/doc/while.n +++ b/doc/while.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: while.n,v 1.3 2000/09/07 14:27:52 poenitz Exp $ +'\" RCS: @(#) $Id: while.n,v 1.3.18.1 2004/10/27 14:43:15 dkf Exp $ '\" .so man.macros .TH while n "" Tcl "Tcl Built-In Commands" @@ -45,9 +45,18 @@ For an example, try the following script with and without the braces around \fB$x<10\fR: .CS set x 0 -while {$x<10} { - puts "x is $x" - incr x +\fBwhile\fR {$x<10} { + puts "x is $x" + incr x +} +.CE +.SH EXAMPLE +Read lines from a channel until we get to the end of the stream, and +print them out with a line-number prepended: +.CS +set lineCount 0 +\fBwhile\fR {[gets $chan line] >= 0} { + puts "[incr lineCount]: $line" } .CE |
