HALCON Reference Manual 10.0.2
Table of Contents / Control ClassesClassesClasses | | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

breakbreakbreakBreakBreak (Operator)

Name

breakbreakbreakBreakBreak — Terminate loop execution.

Signature

break( : : : )

Herror break()

Herror T_break()

Herror break()

void HOperatorSetX.Break()

static void HOperatorSet.Break()

Description

breakbreakbreakBreakBreak terminates the smallest enclosing forforforForFor, whilewhilewhileWhileWhile or repeatrepeatrepeatRepeatRepeat..untiluntiluntilUntilUntil loop. Program execution is continued at the next program line after the end of the loop or at the next line after the breakbreakbreakBreakBreak statement in case no enclosing loop exists.

Example (HDevelop)

read_image (Image, 'monkey')
threshold (Image, Region, 160, 180)
connection (Region, Regions)
Number := |Regions|
AllRegionsValid := 1
* check if for all regions area <=30
for i := 1 to Number by 1
  ObjectSelected := Regions[i]
  area_center (ObjectSelected, Area, Row, Column)
  if (Area > 30)
    AllRegionsValid := 0
    break
  endif
endfor

Result

breakbreakbreakBreakBreak (as operators) always returns 2 (H_MSG_TRUE).

Alternatives

continuecontinuecontinueContinueContinue

See also

forforforForFor, whilewhilewhileWhileWhile, repeatrepeatrepeatRepeatRepeat, untiluntiluntilUntilUntil

Module

Foundation


Table of Contents / Control ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH