summaryrefslogtreecommitdiffstats
path: root/doc/chan.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-01-20 13:42:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-01-20 13:42:17 (GMT)
commit1549d82a2029add6f62dde489d26a70b466f4fd0 (patch)
tree6b453022eb94d1d13ccd73cb7e033e4859af45fd /doc/chan.n
parentee1c40272a0ee43da070323282205173df4a8816 (diff)
downloadtcl-1549d82a2029add6f62dde489d26a70b466f4fd0.zip
tcl-1549d82a2029add6f62dde489d26a70b466f4fd0.tar.gz
tcl-1549d82a2029add6f62dde489d26a70b466f4fd0.tar.bz2
Use a consistent indentation of 4 for code examples.
Diffstat (limited to 'doc/chan.n')
-rw-r--r--doc/chan.n30
1 files changed, 15 insertions, 15 deletions
diff --git a/doc/chan.n b/doc/chan.n
index a413049..067a408 100644
--- a/doc/chan.n
+++ b/doc/chan.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.
'\"
-'\" RCS: @(#) $Id: chan.n,v 1.25 2010/01/14 11:47:08 dkf Exp $
+'\" RCS: @(#) $Id: chan.n,v 1.26 2010/01/20 13:42:17 dkf Exp $
.so man.macros
.TH chan n 8.5 Tcl "Tcl Built-In Commands"
.BS
@@ -769,24 +769,24 @@ set offset 0
\fI# Search for string "FOOBAR" in the file\fR
while {[\fBchan gets\fR $f line] >= 0} {
- set idx [string first FOOBAR $line]
- if {$idx > -1} {
- \fI# Found it; rewrite line\fR
+ set idx [string first FOOBAR $line]
+ if {$idx > -1} {
+ \fI# Found it; rewrite line\fR
- \fBchan seek\fR $f [expr {$offset + $idx}]
- \fBchan puts\fR -nonewline $f BARFOO
+ \fBchan seek\fR $f [expr {$offset + $idx}]
+ \fBchan puts\fR -nonewline $f BARFOO
- \fI# Skip to end of following line, and truncate\fR
- \fBchan gets\fR $f
- \fBchan gets\fR $f
- \fBchan truncate\fR $f
+ \fI# Skip to end of following line, and truncate\fR
+ \fBchan gets\fR $f
+ \fBchan gets\fR $f
+ \fBchan truncate\fR $f
- \fI# Stop searching the file now\fR
- break
- }
+ \fI# Stop searching the file now\fR
+ break
+ }
- \fI# Save offset of start of next line for later\fR
- set offset [\fBchan tell\fR $f]
+ \fI# Save offset of start of next line for later\fR
+ set offset [\fBchan tell\fR $f]
}
\fBchan close\fR $f
.CE