Description:
Break the current loop.
Syntax:
break {a}
Note:
The function breaks a loop whose master cell is a. If a is absent, break the current loop.
Parameter:
a |
The master cell of a loop block. If a is omitted, the function exits the current loop |
Example:
|
A |
B |
C |
D |
|
1 |
=[] |
|
|
|
|
2 |
for 5 |
|
|
|
The result of A1 after computation is a sequence [1, 1, 2, 2, 3, 3]; break A2 is to control the loop of the A2 level.
|
3 |
|
for 2 |
|
|
|
4 |
|
|
if A2==4 |
break A2 |
|
5 |
|
|
>A1=A1|[A2] |
|
|
6 |
=create(ID,Dept) |
|
|
|
|
7 |
=demo.query("select * from EMPLOYEE") |
|
|
|
|
8 |
for A7 |
|
|
|
|
9 |
|
if A8.NAME=="Alexis" |
|
|
Extract the data of DEPT from the EMPLOYEE table and insert them to a table sequence uninterruptedly until the record whose NAME value is "Alexis" appears. |
10 |
|
|
break |
|
|
11 |
|
>A6.insert(0,A8.EID:ID,A8.DEPT:Dept) |
|
|
A6 returns final result as follows:
|