You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `continue` statement can only be used within a [`for`] or [`while`] loop and causes the immediate termination of the current iteration, returning control to the loop head.
9
+
10
+
If used within nested loops the `continue` statement is associated with the innermost enclosing loop.
11
+
12
+
An example of a `continue` statement used within a [`while`] loop.
13
+
14
+
```python
15
+
contract Foo:
16
+
17
+
pub fn bar() -> u256:
18
+
let sum: u256
19
+
whilesum<10:
20
+
sum+=1
21
+
22
+
ifself.some_skip_condition():
23
+
continue
24
+
25
+
returnsum
26
+
27
+
fn some_skip_condition ->bool:
28
+
# some complex logic
29
+
return true
30
+
```
31
+
32
+
An example of a `continue` statement used within a [`for`] loop.
0 commit comments