ClassesClassesClassesClasses | | | | 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).

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

breakbreakBreakbreakBreakBreak (Operator)

Name

breakbreakBreakbreakBreakBreak — Terminate loop execution or leave a switchswitchSwitchswitchSwitchSwitch block.

Signature

break( : : : )

Herror break()

Herror T_break()

Herror break()

void Break()

void HOperatorSetX.Break()

static void HOperatorSet.Break()

Description

breakbreakBreakbreakBreakBreak terminates the smallest enclosing forforForforForFor, whilewhileWhilewhileWhileWhile, or repeatrepeatRepeatrepeatRepeatRepeat..untiluntilUntiluntilUntilUntil loop. In addition, the breakbreakBreakbreakBreakBreak statement is used to leave a switchswitchSwitchswitchSwitchSwitch block, in particular at the end of a casecaseCasecaseCaseCase branch. The program execution is continued at the program line following the corresponding block.

breakbreakBreakbreakBreakBreak statements that are not enclosed by a loop or switchswitchSwitchswitchSwitchSwitch block are invalid.

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

breakbreakBreakbreakBreakBreak (as an operator) always returns 2 (H_MSG_TRUE).

Alternatives

continuecontinueContinuecontinueContinueContinue

See also

forforForforForFor, whilewhileWhilewhileWhileWhile, repeatrepeatRepeatrepeatRepeatRepeat, untiluntilUntiluntilUntilUntil, switchswitchSwitchswitchSwitchSwitch, casecaseCasecaseCaseCase

Module

Foundation


ClassesClassesClassesClasses | | | | Operators