doc: nested loops

This commit is contained in:
Artemy 2022-08-04 11:21:39 +03:00
parent 86e46e9695
commit 54cef02d79

View file

@ -170,7 +170,37 @@
calculated: { calc: [{ var: "calculated" }, "+", 1] }, calculated: { calc: [{ var: "calculated" }, "+", 1] },
}, },
}, },
{ print: ["\rcalculated = ", { var: "calculated" }] }, {
loop: [
{
if: {
condition: { comp: [{ var: "num" }, ">=", 200000] },
body: ["break"],
},
},
{
assign: {
num: { calc: [{ var: "num" }, "+", 1] },
},
},
{
print: [
"\rcalculated = ",
{ var: "calculated" },
"; num = ",
{ var: "num" },
],
},
],
},
{
print: [
"\rcalculated = ",
{ var: "calculated" },
"; num = ",
{ var: "num" },
],
},
{ {
if: { if: {
condition: { comp: [{ var: "calculated" }, ">=", 200000] }, condition: { comp: [{ var: "calculated" }, ">=", 200000] },