37 lines
No EOL
2 KiB
HTML
37 lines
No EOL
2 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>continue — Ludic</title>
|
||
<meta name="description" content="Skip to the next iteration of the loop.">
|
||
<link rel="stylesheet" href="base.css">
|
||
<link rel="stylesheet" href="docs.css">
|
||
</head>
|
||
<body>
|
||
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
|
||
<main class="wrap item">
|
||
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <a href="api.html#control">Control flow</a> <span>›</span> <span class="here">continue</span></div>
|
||
<div class="item-head">
|
||
<span class="kind-badge kind-keyword">keyword</span>
|
||
<h1 id="top">continue</h1>
|
||
</div>
|
||
<code class="sig">continue</code>
|
||
<div class="desc"><p><code>continue</code> abandons the rest of the current loop pass and jumps straight to the next one — the next condition check in a <code>while</code>, or the next index in a <code>for</code>. Use it to skip elements that do not apply without nesting the rest of the body inside an <code>if</code>: filter out empty slots, ignore inactive entities, or step over even numbers. Like <code>break</code>, it acts on the innermost loop only.</p></div>
|
||
|
||
<div class="examples"><h2>Example</h2><pre data-lang="ludic">program SumOdds {
|
||
var total: int = 0
|
||
|
||
handler Add phase Update {
|
||
for i in 0 .. 10 {
|
||
if i % 2 == 0 { continue } # skip even numbers
|
||
total = total + i
|
||
}
|
||
}
|
||
}</pre></div>
|
||
|
||
<a class="back" href="api.html">← All symbols</a>
|
||
</main>
|
||
<script src="ludic-highlight.js"></script>
|
||
<script>Ludic.highlightAll(); Ludic.installCards(); Ludic.flashTarget();</script>
|
||
</body></html> |