standardized call-out blocks
[rrq/rrqforth.git] / adoc / p_break.adoc
index f7da196579288ed75bcf2696fc105735941730c1..dec6fd78242b901701eed5156ab84f033cd1fe7e 100644 (file)
@@ -9,3 +9,24 @@ branch out of an enclosing xef:p_begin[BEGIN]-xref:p_end[END] block.
 Similar to xref:p_ifbreak[IFBREAK] it lays out the branch cell
 followed by a reserved cell for the branch offset, and inserts the
 resolution address just above the required 0 on the data stack.
+
+====
+.Usage example {counter:example}: unconditional break with a condition.
+----
+: WTELL ( tfa -- ; Print word pname )
+  24 + DUP 8 + SWAP @ TELL SP EMIT
+;
+
+: WORDS ( wordlist -- ; Print all words of word list )
+  BEGIN
+    @ DUP IF DUP WTELL ELSE BREAK THEN
+  END
+  DROP
+  NL EMIT
+;
+----
+====
+
+See also <<p_branch,BRANCH>>, <<p_0branch,0BRANCH>>,
+<<p_1branch,1BRANCH>>, <<p_if,IF>>, <<p_else,ELSE>>,
+<<p_ifbreak,IFBREAK>> and <<p_ifagain,IFAGAIN>>.