{"id":3171,"date":"2013-05-15T11:15:14","date_gmt":"2013-05-15T03:15:14","guid":{"rendered":"http:\/\/www.vbtutor.net\/?p=3171"},"modified":"2015-05-07T20:11:17","modified_gmt":"2015-05-07T12:11:17","slug":"using-if-then-else-in-visual-basic","status":"publish","type":"post","link":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/","title":{"rendered":"Using If&#8230;Then&#8230;Else in Visual Basic"},"content":{"rendered":"<p>To control the program flow in Visual Basic 6, we can use various conditional operators. Basically, they resemble mathematical\u00a0 operators. Conditional operators are very powerful tools, they let the Visual Basic 6 program compares data values and then decide what action to take, whether to execute a program or terminate the program and more. \u00a0Some of the conditional operators are <strong>+, -, &gt;, &lt; ,&gt;=<\/strong> and <strong>&lt;=.<\/strong><\/p>\n<p>On top of the conditional operators,\u00a0\u00a0there are a few logical operators which offer added power to the Visual Basic programs. They are <strong>And, Or, Xor<\/strong> and <strong>Not. <\/strong>\u00a0<span style=\"color: #000000;\">To effectively control the Visual Basic program flow, we shall use the\u00a0<strong>If&#8230;Then&#8230;Else\u00a0<\/strong>statement together with the conditional operators and logical operators.<\/span><\/p>\n<p>Read more about conditional and logical operators and the usage of If&#8230;.Then.. Else in our newly updated and enhanced <a title=\"Visual Basic 6 Lesson 7\" href=\"http:\/\/www.vbtutor.net\/vb6\/lesson7.html\">Visual Basic 6 Lesson 7.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To control the program flow in Visual Basic 6, we can use various conditional operators. Basically, they resemble mathematical\u00a0 operators. Conditional operators are very powerful tools, they let the Visual Basic 6 program compares data values and then decide what action to take, whether to execute a program or terminate the program and more. \u00a0Some &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Using If&#8230;Then&#8230;Else in Visual Basic<\/span><\/a><\/p>\n","protected":false},"author":23013,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3171","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using If...Then...Else in Visual Basic - Visual Basic Tutorial<\/title>\n<meta name=\"description\" content=\"This articles discusses the usage of If.....then...Else together with conditional and logical operators in Visual Basic 6\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using If...Then...Else in Visual Basic - Visual Basic Tutorial\" \/>\n<meta property=\"og:description\" content=\"This articles discusses the usage of If.....then...Else together with conditional and logical operators in Visual Basic 6\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Vbtutor\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-15T03:15:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-05-07T12:11:17+00:00\" \/>\n<meta name=\"author\" content=\"Liew Voon Kiong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@liewvk\" \/>\n<meta name=\"twitter:site\" content=\"@liewvk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Liew Voon Kiong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\"},\"author\":{\"name\":\"Liew Voon Kiong\",\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d\"},\"headline\":\"Using If&#8230;Then&#8230;Else in Visual Basic\",\"datePublished\":\"2013-05-15T03:15:14+00:00\",\"dateModified\":\"2015-05-07T12:11:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\"},\"wordCount\":146,\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\",\"url\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\",\"name\":\"Using If...Then...Else in Visual Basic - Visual Basic Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"datePublished\":\"2013-05-15T03:15:14+00:00\",\"dateModified\":\"2015-05-07T12:11:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d\"},\"description\":\"This articles discusses the usage of If.....then...Else together with conditional and logical operators in Visual Basic 6\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using If&#8230;Then&#8230;Else in Visual Basic\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vbtutor.net\/#website\",\"url\":\"https:\/\/www.vbtutor.net\/\",\"name\":\"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"description\":\"Start learning Visual Basic from beginner to advanced. Includes VB.NET, VBA, and classic VB tutorials for students and professionals.\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d\",\"name\":\"Liew Voon Kiong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g\",\"caption\":\"Liew Voon Kiong\"},\"url\":\"https:\/\/www.vbtutor.net\/index.php\/author\/ajt7051vbt\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using If...Then...Else in Visual Basic - Visual Basic Tutorial","description":"This articles discusses the usage of If.....then...Else together with conditional and logical operators in Visual Basic 6","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:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/","og_locale":"en_US","og_type":"article","og_title":"Using If...Then...Else in Visual Basic - Visual Basic Tutorial","og_description":"This articles discusses the usage of If.....then...Else together with conditional and logical operators in Visual Basic 6","og_url":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/","og_site_name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","article_publisher":"https:\/\/www.facebook.com\/Vbtutor","article_published_time":"2013-05-15T03:15:14+00:00","article_modified_time":"2015-05-07T12:11:17+00:00","author":"Liew Voon Kiong","twitter_card":"summary_large_image","twitter_creator":"@liewvk","twitter_site":"@liewvk","twitter_misc":{"Written by":"Liew Voon Kiong","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/#article","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/"},"author":{"name":"Liew Voon Kiong","@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d"},"headline":"Using If&#8230;Then&#8230;Else in Visual Basic","datePublished":"2013-05-15T03:15:14+00:00","dateModified":"2015-05-07T12:11:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/"},"wordCount":146,"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/","url":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/","name":"Using If...Then...Else in Visual Basic - Visual Basic Tutorial","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"datePublished":"2013-05-15T03:15:14+00:00","dateModified":"2015-05-07T12:11:17+00:00","author":{"@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d"},"description":"This articles discusses the usage of If.....then...Else together with conditional and logical operators in Visual Basic 6","breadcrumb":{"@id":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vbtutor.net\/index.php\/2013\/05\/15\/using-if-then-else-in-visual-basic\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Using If&#8230;Then&#8230;Else in Visual Basic"}]},{"@type":"WebSite","@id":"https:\/\/www.vbtutor.net\/#website","url":"https:\/\/www.vbtutor.net\/","name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"Start learning Visual Basic from beginner to advanced. Includes VB.NET, VBA, and classic VB tutorials for students and professionals.","inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d","name":"Liew Voon Kiong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g","caption":"Liew Voon Kiong"},"url":"https:\/\/www.vbtutor.net\/index.php\/author\/ajt7051vbt\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts\/3171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/users\/23013"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/comments?post=3171"}],"version-history":[{"count":4,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts\/3171\/revisions"}],"predecessor-version":[{"id":3174,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts\/3171\/revisions\/3174"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=3171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=3171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=3171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}