<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3342245437054827323</id><updated>2012-02-16T07:46:08.272-08:00</updated><title type='text'>select case vb2008</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://selectcasevb2008.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3342245437054827323/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://selectcasevb2008.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>vbnetcode</name><uri>http://www.blogger.com/profile/04926504053784281645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3342245437054827323.post-4493370567089637784</id><published>2009-02-04T03:22:00.000-08:00</published><updated>2009-02-04T03:23:29.326-08:00</updated><title type='text'></title><content type='html'>Visual Basic 2008 Tutorial&lt;br /&gt;Lesson 10: Select Case Control Structure&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the previous lesson, we have learned how to control the program flow using the If...ElseIf control structure. In this chapter, you will learn  another way to control the program flow, that is, the Select Case control structure. However, the Select Case control structure is slightly different from the If....ElseIf control structure . The difference is that the Select Case control structure basically only make decision on one expression or dimension (for example the examination grade) while the If ...ElseIf statement control structure may evaluate only one expression, each If....ElseIf statement may also compute entirely different dimensions. Select Case is preferred when there exist many different conditions because using If...Then..ElseIf statements might become too messy.&lt;br /&gt;&lt;br /&gt;10.1 The Select Case...End Select Structure&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;The format of the Select Case control structure is show below: &lt;br /&gt;Select Case test expression &lt;br /&gt;&lt;br /&gt;   Case expression list 1&lt;br /&gt;        Block of one or more VB statements &lt;br /&gt;   Case expression list 2&lt;br /&gt;        Block of one or more VB Statements &lt;br /&gt;   Case expression list 3&lt;br /&gt;        Block of one or more VB statements &lt;br /&gt;   Case expression list 4 &lt;br /&gt;        . &lt;br /&gt;        . &lt;br /&gt;        . &lt;br /&gt;   Case Else &lt;br /&gt;        Block of one or more VB Statements &lt;br /&gt;&lt;br /&gt;End Select &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example 10.1 &lt;br /&gt;&lt;br /&gt;' Examination Grades &lt;br /&gt;&lt;br /&gt;Dim grade As String &lt;br /&gt;&lt;br /&gt;Private Sub Compute_Click( ) &lt;br /&gt;&lt;br /&gt;grade=txtgrade.Text &lt;br /&gt;&lt;br /&gt;Select Case grade &lt;br /&gt;&lt;br /&gt;  Case  "A" &lt;br /&gt;       Label1.Text="High Distinction" &lt;br /&gt;  Case "A-" &lt;br /&gt;      Label2.Text="Distinction" &lt;br /&gt;  Case "B" &lt;br /&gt;        Label3.Text="Credit" &lt;br /&gt;  Case "C" &lt;br /&gt;        Label4.Text="Pass" &lt;br /&gt;  Case Else &lt;br /&gt;        Label5.Text="Fail" &lt;br /&gt;  End Select &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example 10.2 &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;In this example, you can use the keyword Is together with the comparison operators.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'Examination Marks &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt; Dim mark As Single &lt;br /&gt;&lt;br /&gt; mark = mrk.Text &lt;br /&gt;  &lt;br /&gt;Select Case mark &lt;br /&gt;&lt;br /&gt; Case Is &gt;= 85 &lt;br /&gt;  &lt;br /&gt;     Label1.Text= "Excellence" &lt;br /&gt;&lt;br /&gt;Case Is &gt;= 70 &lt;br /&gt;  &lt;br /&gt;    Label2.Text= "Good" &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;Case Is &gt;= 60 &lt;br /&gt;&lt;br /&gt;   Label3.Text = "Above Average" &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;Case Is &gt;= 50 &lt;br /&gt;&lt;br /&gt;Label4.Text= "Average" &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;Case Else &lt;br /&gt;&lt;br /&gt;Label5.Text = "Need to work harder" &lt;br /&gt;&lt;br /&gt;End Select &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;End Sub &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example 10.3 &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;Example 10.2 could be rewritten  as follows:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'Examination Marks &lt;br /&gt;&lt;br /&gt;Dim mark As Single &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; mark = mrk.Text &lt;br /&gt;  &lt;br /&gt;Select Case mark &lt;br /&gt;&lt;br /&gt; Case 0 to 49 &lt;br /&gt;  &lt;br /&gt;     Label1.Text = "Need to work harder" &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Case 50 to 59 &lt;br /&gt;  &lt;br /&gt;    Label2.Text = "Average" &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Case 60 to 69 &lt;br /&gt;&lt;br /&gt;   Label3.Text= "Above Average" &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;Case 70 to 84 &lt;br /&gt;&lt;br /&gt;Label4.Text = "Good" &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;Case Else &lt;br /&gt;&lt;br /&gt;Label5.Text= "Excellence" &lt;br /&gt;&lt;br /&gt;End Select &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;End Sub &lt;br /&gt;&lt;br /&gt;¡¡&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source : http://www.vbtutor.net/vb2008/vb2008tutor.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://anesaka-woodtips.blogspot.com"&gt;WOOD TIPS&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://anesaka.blogspot.com"&gt;HOW TOBE PROPESIONAL&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://onlinewood.blogspot.com"&gt;ONLINE WOOD SHOP&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://valuewood.blogspot.com"&gt;VALUE OF WOOD&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://whatiswoodworking.blogspot.com"&gt;WHAT IS WOOD WORKING&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://php-tutorial-riaq.blogspot.com"&gt;php-tutorial-riaq&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://reset-pwd-mysql.blogspot.com"&gt;reset-pwd-mysql&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://restore-database-sql.blogspot.com"&gt;restore-database-sql&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://restore-pass-mysql.blogspot.com"&gt;restore-pass-mysql&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://securing-mysql.blogspot.com"&gt;securing-mysql&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://single-record.blogspot.com"&gt;single-record&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://systemlog-riaq.blogspot.com"&gt;systemlog-riaq&lt;/a&gt;&lt;br/&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=woodworkin09c-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=B000HCZ8EO&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt; &lt;iframe src="http://rcm.amazon.com/e/cm?t=woodworkin09c-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=B001F7AHXM&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3342245437054827323-4493370567089637784?l=selectcasevb2008.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://selectcasevb2008.blogspot.com/feeds/4493370567089637784/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://selectcasevb2008.blogspot.com/2009/02/visual-basic-2008-tutorial-lesson-10.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3342245437054827323/posts/default/4493370567089637784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3342245437054827323/posts/default/4493370567089637784'/><link rel='alternate' type='text/html' href='http://selectcasevb2008.blogspot.com/2009/02/visual-basic-2008-tutorial-lesson-10.html' title=''/><author><name>vbnetcode</name><uri>http://www.blogger.com/profile/04926504053784281645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
