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

DESCRIPTION

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

EXAMPLE

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

SEE ALSO

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

KEYWORDS

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