{"id":34,"date":"2024-09-24T19:05:55","date_gmt":"2024-09-24T18:05:55","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=34"},"modified":"2024-09-24T20:15:10","modified_gmt":"2024-09-24T19:15:10","slug":"msl-compound-statements","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/msl-compound-statements\/","title":{"rendered":"MSL Compound Statements"},"content":{"rendered":"<p>MSL compound statements include loop statements and if statements. In MSL, a sequence of statements can be treated as one statements by enclosing in braces {}. We will call this a statement block and denote it in the statement descriptions as {BLOCK}. The following compound statements can be used to alter or change the flow of control in a MSL program:<\/p>\n<p>if (expression) {BLOCK}<\/p>\n<p>if (expression) {BLOCK} else {BLOCK}<\/p>\n<p>foreach variable in (array) {BLOCK}<\/p>\n<p>foreach variable, variable in (array) {BLOCK}<\/p>\n<p>foreach variable in (hash) {BLOCK}<\/p>\n<p>foreach variable, variable in (hash) {BLOCK}<\/p>\n<p>function name(argument list, &#8230;) {BLOCK}<\/p>\n<p>switch (variable) {<br \/>\ncase a: {BLOCK}<br \/>\n. . .<br \/>\ncase z: {BLOCK}<br \/>\ndefault: {BLOCK}<br \/>\n}<\/p>\n<p>while (expression) {BLOCK}<\/p>\n<p>Note: Compound statements are defined in terms of statement blocks, not statements. This means that the braces are required rather than optional. No dangling statements are allowed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MSL compound statements include loop statements and if statements. In MSL, a sequence of statements can be treated as one statements by enclosing in braces {}. We will call this a statement block and denote it in the statement descriptions as {BLOCK}. The following compound statements can be used to alter or change the flow &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/msl-compound-statements\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MSL Compound Statements&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-34","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":3,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/34\/revisions"}],"predecessor-version":[{"id":41,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/34\/revisions\/41"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}