{"id":188,"date":"2014-12-30T02:54:27","date_gmt":"2014-12-30T01:54:27","guid":{"rendered":"http:\/\/www.valcon.it\/pascal\/?p=188"},"modified":"2014-12-30T02:59:25","modified_gmt":"2014-12-30T01:59:25","slug":"menu-di-scelta","status":"publish","type":"post","link":"https:\/\/www.valcon.it\/pascal\/menu-di-scelta\/","title":{"rendered":"Menu di scelta"},"content":{"rendered":"<p>Una struttura molto comune per i programmi di prova.<br \/>\nViene visualizzato ciclicamente un menu con opzioni<\/p>\n<ul>\n<li><strong>0<\/strong>. Uscita<\/li>\n<li><strong>1<\/strong>. Opzione 1<\/li>\n<li><strong>2<\/strong>. Opzione 2<\/li>\n<li>&#8230;<\/li>\n<li><strong>n<\/strong>. Opzione n<\/li>\n<\/ul>\n<p>L&#8217;utente pu\u00f2 scegliere quale operazione eseguire oppure <em>uscire<\/em> con <strong>0<\/strong>.<\/p>\n<pre>Var\r\n   scelta: Integer;\r\nBegin\r\n   Repeat\r\n      Writeln('---TITOLO---');\r\n      Writeln(' 0. Uscita');\r\n      Writeln(' 1. Opzione 1');\r\n      Writeln(' 2. Opzione 2');\r\n      ...\r\n      Readln(scelta);\r\n      Case(scelta) Of\r\n         0: { ... USCITA ... }\r\n         1: { ... OPZIONE 1 ... }\r\n         2: { ... OPZIONE 2 ... }\r\n         ...\r\n      End;\r\n   Until(scelta = 0);\r\nEnd.<\/pre>\n<h4>Note<\/h4>\n<ol type=\"1\">\n<li>La ripetizione del menu\n<pre>Repeat\r\n   ...\r\nUntil(scelta = 0);<\/pre>\n<\/li>\n<li>L&#8217;esecuzione dell&#8217;operazione corrispondente alla scelta dell&#8217;utente\n<pre>Case(scelta) Of\r\n   ...\r\nEnd;<\/pre>\n<\/li>\n<\/ol>\n<p>Utilizzando <tt>ClrScr<\/tt> si riparte ogni volta con lo schermo pulito&#8230;<\/p>\n<pre>Uses\r\n   Crt;\r\nVar\r\n   scelta: Integer;\r\nBegin\r\n   Repeat\r\n      ClrScr;\r\n      Writeln('--- TITOLO ------------------------');\r\n      Writeln(' 0. Uscita');\r\n      Writeln(' 1. Opzione 1');\r\n      Writeln(' 2. Opzione 2');\r\n      ...\r\n      Readln(scelta);\r\n      ClrScr;\r\n      Writeln('-----------------------------------');\r\n      Case(scelta) Of\r\n         0: { ... USCITA ... }\r\n         1: { ... OPZIONE 1 ... }\r\n         2: { ... OPZIONE 2 ... }\r\n         ...\r\n      End;\r\n      Writeln;\r\n      Writeln('-----------------------------------');\r\n      Writeln('Premi INVIO per continuare');\r\n      Readln;\r\n   Until(scelta = 0);\r\nEnd.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Una struttura molto comune per i programmi di prova. Viene visualizzato ciclicamente un menu con opzioni 0. Uscita 1. Opzione 1 2. Opzione 2 &#8230; n. Opzione n L&#8217;utente pu\u00f2 scegliere quale operazione eseguire oppure uscire con 0. Var scelta: Integer; Begin Repeat Writeln(&#8216;&#8212;TITOLO&#8212;&#8216;); Writeln(&#8216; 0. Uscita&#8217;); Writeln(&#8216; 1. Opzione 1&#8217;); Writeln(&#8216; 2. Opzione 2&#8217;); &#8230; <a title=\"Menu di scelta\" class=\"read-more\" href=\"https:\/\/www.valcon.it\/pascal\/menu-di-scelta\/\" aria-label=\"Leggi di pi\u00f9 su Menu di scelta\">Leggi tutto<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/posts\/188"}],"collection":[{"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":4,"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/posts\/188\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.valcon.it\/pascal\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}