From 92cfa50b5bb99a38f735143485e1cc9588930a39 Mon Sep 17 00:00:00 2001 From: Jason Self Date: Sun, 2 Jun 2019 08:56:59 -0700 Subject: [PATCH] Add Loop control --- informqr/informqr.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/informqr/informqr.md b/informqr/informqr.md index 0dee485..c43d0c4 100644 --- a/informqr/informqr.md +++ b/informqr/informqr.md @@ -1,4 +1,4 @@ -o% Inform in four minutes +% Inform in four minutes % Roger Firth A quick reference to the Inform programming language. @@ -387,4 +387,41 @@ where each *value* can be given as: constant lo_constant to hi_constant - constant,constant, ... constant \ No newline at end of file + constant,constant, ... constant + +Loop control +------------ + +To execute statements while *expr* is true: + + while (expr) + statement_block + +To execute statements until *expr* is true: + + do + statement_block + until (expr) + +To execute statements while a variable changes: + + for (set_var : loop_while_expr : update_var ) + statement_block + +To execute statements for all defined objects: + + objectloop (variable) + statement_block + +To execute statements for all objects selected by *expr*: + + objectloop (expr_starting_with_variable) + statement_block + +To jump out of the current innermost loop or switch: + + break; + +To immediately start the next iteration of the current loop: + + continue; \ No newline at end of file -- 2.31.1