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

26 lines
906 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Continue Operator
The continue operator passes control to the beginning of the nearest outward loop [while](/en/docs/basis/operators/while), [do-while](/en/docs/basis/operators/dowhile) or [for](/en/docs/basis/operators/for) operator, the next iteration being called. The purpose of this operator is opposite to that of [break](/en/docs/basis/operators/break) operator.
Example:
```
//--- Sum of all nonzero elements
int func(int array[])
  {
   int array_size=ArraySize(array);
   int sum=0;
   for(int i=0;i<array_size; i++)
     {
      if(a[i]==0) continue;
      sum+=a[i];
     }
   return(sum);
  }
```
See also
[Initialization of Variables](/en/docs/basis/variables/initialization), [Visibility Scope and Lifetime of Variables](/en/docs/basis/variables/variable_scope), [Creating and Deleting Objects](/en/docs/basis/variables/object_live)