diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2023-05-31 10:33:01 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2023-05-31 10:33:01 (GMT) |
commit | 38c9c34398bc61793d4794a1c4dadb3a36f23847 (patch) | |
tree | 60950a8e49337252996f44d01e2adcfb7292ae94 /doc | |
parent | d3acda84955821249bc38d697afe3cc890ac1bf2 (diff) | |
download | tcl-38c9c34398bc61793d4794a1c4dadb3a36f23847.zip tcl-38c9c34398bc61793d4794a1c4dadb3a36f23847.tar.gz tcl-38c9c34398bc61793d4794a1c4dadb3a36f23847.tar.bz2 |
Swapped foreachLine arg order, improved docs
Diffstat (limited to 'doc')
-rw-r--r-- | doc/library.n | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/library.n b/doc/library.n index ce1174c..984dc8a 100644 --- a/doc/library.n +++ b/doc/library.n @@ -246,14 +246,17 @@ boundaries before the starting point in the given string. The index returned refers to the second character of the pair that comprises a boundary. .TP -\fBforeachLine \fIfilename varName body\fR +\fBforeachLine \fIvarName filename body\fR .VS "Tcl 8.7, TIP 670" This reads in the text file named \fIfilename\fR one line at a time (using system defaults for reading text files). It writes that line to the variable named by \fIvarName\fR and then executes \fIbody\fR for that line. The result value of \fIbody\fR is ignored, but \fBerror\fR, \fBreturn\fR, -\fBbreak\fR and \fBcontinue\fR may be used within it. -The overall result of \fBforeachLine\fR is the empty string; the file will be +\fBbreak\fR and \fBcontinue\fR may be used within it to produce an error, +return from the calling context, stop the loop, or go to the next line +respectively. +The overall result of \fBforeachLine\fR is the empty string (assuming no +errors from I/O or from evaluating the body of the loop); the file will be closed prior to the procedure returning. .VE "Tcl 8.7, TIP 670" .TP |