Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/continue.n @ 42

Last change on this file since 42 was 25, checked in by landauf, 17 years ago

added tcl to libs

File size: 1.3 KB
Line 
1'\"
2'\" Copyright (c) 1993-1994 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: continue.n,v 1.10 2007/12/13 15:22:32 dgp Exp $
9'\"
10.so man.macros
11.TH continue n "" Tcl "Tcl Built-In Commands"
12.BS
13'\" Note:  do not modify the .SH NAME line immediately below!
14.SH NAME
15continue \- Skip to the next iteration of a loop
16.SH SYNOPSIS
17\fBcontinue\fR
18.BE
19
20.SH DESCRIPTION
21.PP
22This command is typically invoked inside the body of a looping command
23such as \fBfor\fR or \fBforeach\fR or \fBwhile\fR.
24It returns a \fBTCL_CONTINUE\fR code, which causes a continue exception
25to occur.
26The exception causes the current script to be aborted
27out to the innermost containing loop command, which then
28continues with the next iteration of the loop.
29Catch exceptions are also handled in a few other situations, such
30as the \fBcatch\fR command and the outermost scripts of procedure
31bodies.
32.SH EXAMPLE
33Print a line for each of the integers from 0 to 10 \fIexcept\fR 5:
34.CS
35for {set x 0} {$x<10} {incr x} {
36   if {$x == 5} {
37      \fBcontinue\fR
38   }
39   puts "x is $x"
40}
41.CE
42
43.SH "SEE ALSO"
44break(n), for(n), foreach(n), return(n), while(n)
45
46.SH KEYWORDS
47continue, iteration, loop
Note: See TracBrowser for help on using the repository browser.