Files
mql5-skills/skills/mql5/references/docs/00-basis/0044-basis-operators-break.md
T
2026-06-23 21:47:51 +08:00

831 B

Break Operator

The break operator terminates the execution of the nearest nested outward switch, while, do-while or for operator. The control is passed to the operator that follows the terminated one. One of the purposes of this operator is to finish the looping execution when a certain value is assigned to a variable.

Example:

//--- searching for the first zero element
for(i=0;i<array_size;i++)
  if(array[i]==0)
    break;

See also

Initialization of Variables, Visibility Scope and Lifetime of Variables, Creating and Deleting Objects