1break(n)                     Tcl Built-In Commands                    break(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       break - Abort looping command
9

SYNOPSIS

11       break
12_________________________________________________________________
13
14

DESCRIPTION

16       This  command is typically invoked inside the body of a looping command
17       such as for or foreach or while.  It returns a  TCL_BREAK  code,  which
18       causes  a  break  exception to occur.  The exception causes the current
19       script to be aborted out to  the  innermost  containing  loop  command,
20       which then aborts its execution and returns normally.  Break exceptions
21       are also handled in a few other situations, such as the catch  command,
22       Tk event bindings, and the outermost scripts of procedure bodies.
23

EXAMPLE

25       Print a line for each of the integers from 0 to 5:
26              for {set x 0} {$x<10} {incr x} {
27                 if {$x > 5} {
28                    break
29                 }
30                 puts "x is $x"
31              }
32
33

SEE ALSO

35       catch(n), continue(n), for(n), foreach(n), return(n), while(n)
36
37

KEYWORDS

39       abort, break, loop
40
41
42
43Tcl                                                                   break(n)
Impressum