<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Comment Feed for Channel 9 - Branching with the If . . . Then . . . Else Decision Statement - 06</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06/RSS"></atom:link>
	<image>
		<url>http://ak.channel9.msdn.com/ch9/d8a0/ad0276a5-b982-478c-9391-9f9d000bd8a0/06VBBranchingwiththeIfThenElseDecisionStatement_100_ch9.jpg</url>
		<title>Channel 9 - Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<link></link>
	</image>
	<description>Branching allows us to add logic to our applications. In this lesson you&#39;re introduced to the If Decision statement (in its various forms) as well as the IIf conditional function. We also discuss how to refactor our code to make it more compact and less likely to produce errors by eliminating duplicate code. &amp;nbsp; Download the source code for Branching with the If... </description>
	<link></link>
	<language>en</language>
	<pubDate>Sun, 19 May 2013 11:01:29 GMT</pubDate>
	<lastBuildDate>Sun, 19 May 2013 11:01:29 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>Very cool love the example in the end.&nbsp; Never knew about the {0} and the iif, really cool!</p><p>posted by Algorithum</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634575343526156010</link>
		<pubDate>Tue, 22 Nov 2011 04:52:32 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634575343526156010</guid>
		<dc:creator>Algorithum</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[Can I use if, else, in Access&#63; If so how&#63;<p>posted by Joe</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634610583392709611</link>
		<pubDate>Sun, 01 Jan 2012 23:45:39 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634610583392709611</guid>
		<dc:creator>Joe</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634575343526156010">Algorithum</a>: Cool!</p><p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634610583392709611">Joe</a>: Sorry, I am NOT an Access or vbScript guy so I'll have to rely on someone else to answer definitively.&nbsp; (I'm betting you can, though.)</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634613296259889751</link>
		<pubDate>Thu, 05 Jan 2012 03:07:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634613296259889751</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[I would like to use a goto statement with if else then statement here to create some loops.<br>Could we build loops using only if else then statements&#63;<br><p>posted by halitates</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634641646777453178</link>
		<pubDate>Mon, 06 Feb 2012 22:37:57 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634641646777453178</guid>
		<dc:creator>halitates</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[This lesson is very informative. Loved it&#33; Thanks.<p>posted by Ken</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634665219956657866</link>
		<pubDate>Mon, 05 Mar 2012 05:26:35 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634665219956657866</guid>
		<dc:creator>Ken</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[Hi Bob. When  try to add a word inside of a sentence, it deletes the letter in front of it. How do i fix this&#63;<p>posted by Austin Enos</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634668299511348942</link>
		<pubDate>Thu, 08 Mar 2012 18:59:11 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634668299511348942</guid>
		<dc:creator>Austin Enos</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634641646777453178">halitates</a>: I suppose, but I would encourage you to use for ... next, while, do .. while, etc. &nbsp;The use of &quot;goto&quot; has become a &quot;religious battle&quot; with some claiming it indicates bad code and others claiming it's just fine. &nbsp;I generally stay away from it ... the statements I demonstrate are generally considered to be &quot;safe&quot;.</p><p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634668299511348942">Austin Enos</a>: Wild. &nbsp;Could you post your code? &nbsp;I promise to take a look at it and help you figure it out.</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634669082940909168</link>
		<pubDate>Fri, 09 Mar 2012 16:44:54 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634669082940909168</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[&#64;bobTabor Thanks for such nice &#38; informative video .... this video will helpful for the beginners....<br><br>please Add some Extra videos with other useful Commands and Examples...<br><br>at last ... Please Add Videos on the Development of &#34;Windows notification area&#34; Thanks<p>posted by Jag mohan</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634721771755988937</link>
		<pubDate>Wed, 09 May 2012 16:19:35 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634721771755988937</guid>
		<dc:creator>Jag mohan</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634721771755988937">Jag mohan</a>: &nbsp;Thanks for the nice note! &nbsp;The best place to make these requests (and convey your compliments)? &nbsp;That little Feedback icon in the footer of this site. &nbsp;Microsoft reads those more closely and they will contact me (or someone more qualified) to build out that content you're looking for. &nbsp;They DO listen, in my experience. &nbsp;Best wishes!</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634722057471407414</link>
		<pubDate>Thu, 10 May 2012 00:15:47 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634722057471407414</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>Thank you BOB for those videos .</p><p>Even I really got very sad because you did not respond me to all my letter on learnvisualstio.net</p><p>I still love you , and I appreciate the way you make lessons easy to understand for somebody who even knows nothing about alogarythim or whatever more.</p><p>And for sure this is my case .</p><p>posted by Mbonga</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634747758522467462</link>
		<pubDate>Fri, 08 Jun 2012 18:10:52 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634747758522467462</guid>
		<dc:creator>Mbonga</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634747758522467462">Mbonga</a>: Hi and sorry you didn't get a reply ... I have someone filtering messages because I get quite a few and I have to find some time to actually do work. &nbsp;<img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> &nbsp;Please write me directly ... bob at learn visual studio dot net and I'll try to help if I can. &nbsp;Best wishes!</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634748082157183176</link>
		<pubDate>Sat, 09 Jun 2012 03:10:15 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634748082157183176</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[When I try to follow the example, I get an error message that says&#58; Console.WriteLine is a value and therefore cannot be the target of the assignment.<p>posted by Ginny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761442164035856</link>
		<pubDate>Sun, 24 Jun 2012 14:16:56 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761442164035856</guid>
		<dc:creator>Ginny</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[When I try to follow the elseif example, the console.write doesn&#39;t write with 1, 2, or 3. It does write with the last choice.<p>posted by Ginny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761458560513616</link>
		<pubDate>Sun, 24 Jun 2012 14:44:16 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761458560513616</guid>
		<dc:creator>Ginny</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[When I try to follow the elseif example, the console.write doesn&#39;t write with 1, 2, or 3. It does write with the last choice.<p>posted by Ginny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761458577986442</link>
		<pubDate>Sun, 24 Jun 2012 14:44:17 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761458577986442</guid>
		<dc:creator>Ginny</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634761442164035856">Ginny</a>: Hi Ginny, I'm betting that you have a really small error in your code. &nbsp;You can post it directly in here and I can help you find the problem, OR you could simply look very very closely at your syntax. &nbsp;It's possible you're missing a single character ... it has to be EXACT. &nbsp;<img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> &nbsp;Don't worry, you get better at it with practice. &nbsp;Feel free to post your exact code right here and I'll help if I can.</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634762449553050235</link>
		<pubDate>Mon, 25 Jun 2012 18:15:55 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634762449553050235</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>opening thread</p><p>&nbsp;</p><p>posted by golnazal</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634976872741595590</link>
		<pubDate>Thu, 28 Feb 2013 22:27:54 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c634976872741595590</guid>
		<dc:creator>golnazal</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>Hi!</p><p>Great work on these vids Bob. Clear and concise and newbie friendly.</p><p>Ok. I have watched a few vids and I am just playing around with a few things but there is something I would like explained please.. Here is an example that I hope will help&nbsp;to understand&nbsp;my question...</p><p>&nbsp;**edit** sorry, after posting and reading I noticed that my code didn't paste in quite right with some lines being broken up into multiple lines, its obvious where this has happened so I doubt it will cause any misunderstanding. Just thought I would clarify incase you thought it was the way I actually typed it into the IDE...&nbsp; Anyways-----</p><p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p><p>Console.WriteLine(&quot;Please enter your name.&quot;)</p><p>&nbsp;&nbsp;Dim userName As String = Console.Readline</p><p>&nbsp;&nbsp;Console.WriteLine(&quot;Ok then &quot; &amp; userName &amp; &quot;. You stand in a room with three doors. One</p><p>red, one blue and one green.&quot; &amp; vbCrLf &amp; &quot; &lt;enter to continue&gt; &quot;)&nbsp;</p><p>&nbsp; Console.ReadLine()</p><p>&nbsp; Console.WriteLine(&quot;It's a simple choice &quot; &amp; userName &amp; &quot;, pick a colour.&quot; &amp; vbCrLf &amp; &quot;&lt;red&gt;&quot;</p><p>&amp; vbCrLf &amp; &quot;&lt;blue&gt;&quot; &amp; vbCrLf &amp; &quot;&lt;green&gt;&quot;)</p><p>&nbsp;&nbsp;Dim doorChoice As String = Console.Readline()</p><p>&nbsp;&nbsp;Dim doorChoiceMessage = &quot;&quot;&nbsp;&nbsp;</p><p>&nbsp;&nbsp;If doorChoice = &quot;red&quot; Then</p><p>&nbsp; doorChoiceMessage = &quot;You open the red door and are instantly engulfed in flames. Death!&quot;</p><p>&nbsp;&nbsp;ElseIf doorChoice = &quot;blue&quot; Then</p><p>&nbsp; doorChoiceMessage = &quot;You open the blue door and are pounded by a tidal wave, drowning</p><p>you. Death!&quot;</p><p>&nbsp;&nbsp;ElseIf doorChoice = &quot;green&quot; Then</p><p>&nbsp; doorChoiceMessage = &quot;You open the green door and step inside. A lush garden bustling</p><p>with life takes you quite by suprise.&quot;</p><p>&nbsp;&nbsp;Else &nbsp;&nbsp;doorChoiceMessage = &quot;You couldn't make a decision. You feel your lungs start to burn as</p><p>the room fills with a noxious gas. You slowly drift away into........ Death!&quot;</p><p>&nbsp;&nbsp;End If</p><p>&nbsp;&nbsp;Console.WriteLine(doorChoiceMessage)</p><p>&nbsp; Console.ReadLine()</p><p>&nbsp;</p><p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p><p>&nbsp;</p><p>Now, my problem is that I don't know how to move the code along after the correct choice is made (ie: green)&nbsp; If I simply place another WriteLine at the bottom it will proceed to that BUT it will also go to that even if I choose one of the wrong &quot;doors&quot; instead of simply ending the console.&nbsp; So how do I execute a particular block of code from within an If...Then...ElseIf...Else statement? And if for instance, I wanted each of those choices to lead to another block of code with another choice instead of ending the console with &quot;Death&quot; how would I acheive that?</p><p>posted by MilesWilliams</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635006280335885057</link>
		<pubDate>Wed, 03 Apr 2013 23:20:33 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635006280335885057</guid>
		<dc:creator>MilesWilliams</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635006280335885057">MilesWilliams</a>: Ahh yes ... reminds me of my first text-based adventure I wrote in BASIC on the Commodore 64 ... fun times. &nbsp;</p><p>I hope you don't mind if I took the ball and ran with it. &nbsp; <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-14.gif?v=c9' alt='Devil' /></p><p><a href="https://gist.github.com/anonymous/7856d78bed1b6e138011">https&#58;&#47;&#47;gist.github.com&#47;anonymous&#47;7856d78bed1b6e138011</a></p><p>I demo a few things here:</p><p>(1) I answered your exact question. &nbsp;I broke the choices into Sub methods. &nbsp;By doing so, I can manage what happens next without if statements&nbsp;embedded&nbsp;in if statements embedded in if statements.</p><p>(2) I also added a loop at the very beginning. &nbsp;This allows the player to play again and try different options.</p><p>(3) I added another option after the Green Door scenario ... this is a demo of how you would continue to add to the story and further branch. &nbsp;Ultimately, you'll need some naming convention ... or method of organizing the Subs. &nbsp;You could even use a bunch of additional Module .vb files to accomplish this.</p><p>Having said all of that, I probably wouldn't write this application quite this way. &nbsp;I might take a more Object&nbsp;Oriented&nbsp;approach. &nbsp;You'll learn about that later in this series. &nbsp;Hopefully this will allow you to experiment more and see another way to &quot;solve&quot; this dilemma. &nbsp;Like I said earlier, this is exactly how I learned ... I created a text-based adventure based on Dungeons &amp; Dragons which I was really into as a kid. &nbsp;Good luck!!!</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007117536869814</link>
		<pubDate>Thu, 04 Apr 2013 22:35:53 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007117536869814</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007117536869814">BobTabor</a>:</p><p>Wow! Thank you for the extremely swift reply Bob.</p><p>After&nbsp;my OP&nbsp;I thought about it some more and was wondering if the GoTo command would be a viable option?</p><p>But after seeing what you have done I guess that would probably make a mess of things, someone once told me to keep away from using the GoTo command too much.</p><p>I thought a text based adventure would probably be the easiest&nbsp; way to get accustomed to writing in VB.&nbsp;And yeah i too played D&amp;D as a kid. Good times.</p><p>I was hoping to use a bunch of Module.vb's as you suggested as well as txt files that stored data that i could pull in and out of the code but was unsure how to go about this or if it&nbsp;would even work.&nbsp;Not sure if using the txt files is neccessary though. I just thought it would be easier to modify things if I just had to open a txt and change some values instead of sifting through code to find them.</p><p>I will continue watching the videos and hopefully by the end I will have some more ideas.. I just watched the one on dates and timespan and thought of a good idea for random encounters to be generated after a certain amount of time has passed within a certain &quot;area&quot; of the game.. Also setting a real-time to game-time ratio that makes your character &quot;age&quot; as well.. But for now I just need to focus on making the player move throughout the code. Next I want to be able to assign &quot;stats&quot; and &quot;attributes&quot; to the player&nbsp;and work on a combat system&nbsp;with a random number generator that is modified by these factors. And also certain player choices&nbsp;would be&nbsp;affected by them.. I know it will take a while to figure all this out but I am determined.</p><p>Again, thank you for the swift reply and the tremendously helpful answers. I havn't had the time to try it out yet but once I do I am sure I will have more questions..</p><p>Fabulous video series, excellent job. Fantastic teacher! Love your work Bob!&nbsp;</p><p>&nbsp;</p><p>Oh by the way ,&nbsp;I love the entrance of the &quot;strange little man&quot; too funny!</p><p>&nbsp;</p><p>**edit**</p><p>I am guessing the ToLower is so that the players input is not case sensitive?</p><p>Also am guessing that using the Call command is better than a GoTo as it calls up another Sub Procedure instead of just moving to a particular line of code, obviously there are other reasons behind this choice?</p><p>posted by MilesWilliams</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007138287078843</link>
		<pubDate>Thu, 04 Apr 2013 23:10:28 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007138287078843</guid>
		<dc:creator>MilesWilliams</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007117536869814">BobTabor</a>:</p><p>There is one thing that I am curious on though Bob? At the start it asks for your name, then proceeds to the Call command and moves to that particular Sub being referenced. Upon &quot;death&quot; and the Call command having run its course does it simply go back to the next line of code in Sub Main after the initial Call command was executed? Is this where a GoTo would come in handy, if I for instance had other code after the initial Call command that I wanted to skip past? Naming a line further down in the code and moving to that with GoTo instead? I am trying to understand where a GoTo would be useful as it seems like it could be a handy tool but I have been frightened away from it from a work colleague (who codes in C and Delphi but knows a bit of VB)</p><p>posted by MilesWilliams</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007156275248606</link>
		<pubDate>Thu, 04 Apr 2013 23:40:27 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007156275248606</guid>
		<dc:creator>MilesWilliams</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007156275248606">MilesWilliams</a>: Generally, I never recommend a GOTO ... I would instead labor to allow code to return or &quot;fall out&quot; of the Subs, kind of like what I demonstrated in the code examples. &nbsp;Does that make sense?</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007159704858493</link>
		<pubDate>Thu, 04 Apr 2013 23:46:10 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635007159704858493</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[i having trouble with if then else <br>i really don&#39;t know how to do a several if  them else. <br>example&#58; input, &#34;enter your age&#58;&#34; 16.<br>display, can you drive &#34;yes&#34;<br>display, &#34;you won a car&#34;<br>and if you enter a different number<br>example&#58; input, &#34;enter your age&#58;&#34; 10.<br>display, can you drive &#34;no&#34;<br>display, &#34;sorry to young&#34;<br><p>posted by david jones</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635022423640853066</link>
		<pubDate>Mon, 22 Apr 2013 15:46:04 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635022423640853066</guid>
		<dc:creator>david jones</dc:creator>
	</item>
	<item>
		<title>Re: Branching with the If . . . Then . . . Else Decision Statement - 06</title>
		<description>
			<![CDATA[<p>@<a href="/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635022423640853066">david jones</a>: You would simply embed one if then INSIDE of another if then. &nbsp;See below how I embed one inside of another (first case):</p><p><pre class="brush: vb">
Console.WriteLine(&quot;How old are you?&quot;)
Dim ageAnswer as String
ageAnswer = Console.ReadLine()

Dim age as Integer
age = CInt(ageAnswer)

If age =&gt; 16 Then

    Dim driveAnswer as String

    Console.WriteLine(&quot;Can you drive a car (type: yes or no)?&quot;)
    driveAnswer = Console.ReadLine()

    If driveAnswer = &quot;yes&quot; Then
      Console.WriteLine(&quot;You must be able to drive to win a car&quot;)
    End If

Else
    Console.WriteLine(&quot;You are too young to drive a car&quot;)
End If

Console.ReadLine()</pre></p><p>&nbsp;</p><p>Note: My code doesn't match yours exactly because if you're younger than 10, it's irrelevant whether or not you can drive ... you're too young regardless! &nbsp;I know this is a silly example ... if you needed to, you could perform another If Then in there, too. &nbsp;And even another one inside of that!</p><p>At some point, if you were to embed several layers deep, you should ask yourself if there's a better way to do what you want. &nbsp;That might get confusing and hard to read. &nbsp;I would switch out to using methods / functions / subs at that point. &nbsp;Good luck!</p><p>posted by BobTabor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635022648654151923</link>
		<pubDate>Mon, 22 Apr 2013 22:01:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners/Branching-with-the-If----Then----Else-Decision-Statement-06#c635022648654151923</guid>
		<dc:creator>BobTabor</dc:creator>
	</item>
</channel>
</rss>