HALCON Reference Manual / Control Operators

break (Operator)

Name

break — Terminate loop execution.

Synopsis

break( : : : )

Description

break terminates the smallest enclosing for, while or repeat..until loop. Program execution is continued at the next program line after the end of the loop or at the next line after the break statement in case no enclosing loop exists.

Example

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

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

Alternatives

continue

See also

for, while, repeat, until

Module

Foundation


HALCON Reference Manual / Control Operators
Version 9.0.2 Copyright © 1996-2010 MVTec Software GmbH