{"id":1362,"date":"2019-03-25T17:34:46","date_gmt":"2019-03-25T20:34:46","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/"},"modified":"2019-05-29T17:06:46","modified_gmt":"2019-05-29T20:06:46","slug":"basic-vbscript-for-elipse-e3-lesson-5-flow-control","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/","title":{"rendered":"Basic VBScript for Elipse E3: Lesson 5 &#8211; Flow Control"},"content":{"rendered":"<p><span style=\"font-weight: bold; font-size: large;\"><span style=\"color: #990099;\">For&#8230;Next <\/span><span id=\"anchor_div\" style=\"color: #990099;\"> <\/span><span style=\"color: #990099;\">Command<\/span><\/span><\/p>\n<p>Repeats a block of instructions a certain number of times, from to .<br \/>\n<br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">For < counter > = < start > To < end > <\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">< block of instructions > <\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">Next<\/span><\/p>\n<p>Examples:<\/p>\n<p><span style=\"background-color: #cccccc; font-family: Courier New;\">&#8216;Erase the displays<\/span><br style=\"background-color: #cccccc; font-family: Courier New;\" \/><span style=\"background-color: #cccccc; font-family: Courier New;\">For i=1 to 5<\/span><br style=\"background-color: #cccccc; font-family: Courier New;\" \/><span style=\"background-color: #cccccc; font-family: Courier New;\">Screen.Item(&#8220;Display&#8221;&#038;i).Value = 0<\/span><br style=\"background-color: #cccccc; font-family: Courier New;\" \/><span style=\"background-color: #cccccc; font-family: Courier New;\">next<\/span><\/p>\n<p><span style=\"font-weight: bold; font-style: italic; color: #3366ff; font-size: large;\">Exercises:<\/span><\/p>\n<p>1. Create three demo tags.<br \/>\n2. Insert a chart on screen.<br \/>\n<span style=\"background-color: #ffffff;\">3. By clicking on an [Add] <\/span><span style=\"background-color: #ffffff;\">button<\/span><span style=\"background-color: #ffffff;\">, create a pen for each tag.<\/span><br style=\"background-color: #ffffff;\" \/><span style=\"background-color: #ffffff;\">4. By clicking on a [Remove]<\/span><span style=\"background-color: #ffffff;\"> button<\/span><span style=\"background-color: #ffffff;\">,<\/span> remove all the pens.<\/p>\n<p><span style=\"font-weight: bold; font-size: large;\"><span style=\"color: #990099;\">For Each \u2026 Next Command<\/span><\/span><\/p>\n<p>A For Each&#8230;Next loop is similar to a For&#8230;Next loop. Instead of repeating the instructions of a block a specific number of times, a For Each\u2026Next loop repeats a group of commands for each item in a collection. This command is useful when we do not know the quantity of elements.<\/p>\n<p><span style=\"font-family: Courier New; background-color: #cccccc;\">For each < object > in < Collection > <\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">< block of instructions > <\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">Next<\/span><\/p>\n<p>Examples:<\/p>\n<p><span style=\"font-family: Courier New; background-color: #cccccc;\">&#8216;Display the name of all the tags<\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">For each tag in Application.GetObject(&#8220;Data&#8221;)<\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">MsgBox tag.Name<\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">next<\/span><\/p>\n<p><span style=\"font-style: italic; font-size: large;\"><span style=\"color: #3366ff; font-weight: bold;\">Exercises:<\/span><\/span><\/p>\n<p>5. Create three demonstration tags.<br \/>\n6. Insert a chart on screen.<br \/>\n7. By clicking on an [Add] button, create a pen for each tag.<\/p>\n<p><span style=\"font-size: large;\"><span style=\"color: #990099; font-weight: bold;\">While&#8230;Wend Command<\/span><\/span><\/p>\n<p>This command executes a block of instructions while a certain condition is true:<\/p>\n<p><span style=\"font-family: Courier New; background-color: #cccccc;\">While < condition > <\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">< block of instructions ><\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">Wend<\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/>Examples:<\/p>\n<p><span style=\"font-family: Courier New; background-color: #cccccc;\">&#8216;Add 1 while it is less than 10<\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">While Tag.Value < 10 <\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">Tag.Value = Tag.Value + 1<\/span><br style=\"font-family: Courier New; background-color: #cccccc;\" \/><span style=\"font-family: Courier New; background-color: #cccccc;\">Wend<\/span><\/p>\n<p><span style=\"font-weight: bold; font-style: italic; font-size: large;\"><span style=\"color: #3366ff;\">Exercises:<\/span><\/span><\/p>\n<p>8. Create a horizontal rectangle on screen that woks a progress bar.<br \/>\n9. Make the rectangle&#8217;s HorizontalPercentFill property range from 0 to 100 within a while command. Tip: To refresh the screen, use Frame&#8217;s Refresh command.<\/p>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/Lesson5.zip\">Lesson5.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Autor<br \/>\nPaula Pereira En\u00e9as<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Basic VBScript for Elipse E3: Lesson 5 - Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:] - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basic VBScript for Elipse E3: Lesson 5 - Flow Control\" \/>\n<meta property=\"og:description\" content=\"Autor Paula Pereira En\u00e9as\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:34:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-29T20:06:46+00:00\" \/>\n<meta name=\"author\" content=\"Elipse Software\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elipse Software\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\"},\"author\":{\"name\":\"Elipse Software\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\"},\"headline\":\"Basic VBScript for Elipse E3: Lesson 5 &#8211; Flow Control\",\"datePublished\":\"2019-03-25T20:34:46+00:00\",\"dateModified\":\"2019-05-29T20:06:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\"},\"wordCount\":533,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\",\"name\":\"[:pt]Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:en]Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:34:46+00:00\",\"dateModified\":\"2019-05-29T20:06:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Basic VBScript for Elipse E3: Lesson 5 &#8211; Flow Control\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\",\"name\":\"Elipse Software\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"caption\":\"Elipse Software\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basic VBScript for Elipse E3: Lesson 5 - Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:] - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:en]Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:] - Elipse Knowledgebase","og_description":"[:pt]Autor Paula Pereira En\u00e9as[:en]Autor Paula Pereira En\u00e9as[:]","og_url":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:34:46+00:00","article_modified_time":"2019-05-29T20:06:46+00:00","author":"Elipse Software","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Elipse Software","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/"},"author":{"name":"Elipse Software","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87"},"headline":"Basic VBScript for Elipse E3: Lesson 5 &#8211; Flow Control","datePublished":"2019-03-25T20:34:46+00:00","dateModified":"2019-05-29T20:06:46+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/"},"wordCount":533,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/","url":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/","name":"[:pt]Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:en]Basic VBScript for Elipse E3: Lesson 5 - Flow Control[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:34:46+00:00","dateModified":"2019-05-29T20:06:46+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/basic-vbscript-for-elipse-e3-lesson-5-flow-control\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Basic VBScript for Elipse E3: Lesson 5 &#8211; Flow Control"}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87","name":"Elipse Software","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","caption":"Elipse Software"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/1362"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=1362"}],"version-history":[{"count":9,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/1362\/revisions"}],"predecessor-version":[{"id":6741,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/1362\/revisions\/6741"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=1362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=1362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=1362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}