Select Case
Upcoming SlideShare
Loading in...5
×
 

Select Case

on

  • 578 views

 

Statistics

Views

Total Views
578
Views on SlideShare
578
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Select Case Select Case Presentation Transcript

    • CONDITIONAL STATEMENTS
    • IF Statement
      • Allows your program to make decisions based on certain conditions.
    • 1. If… Then
      • Syntax:
      • If condition Then
      • Statement/s
      • End If
    • 2. If… Then… Else
      • Syntax:
      • If condition Then
      • Statement/s
      • Else
      • Statement/s
      • End If
    • IF… ELSEIF Statement
      • If 1 st condition Then
      • statement if the 1st condition is true
      • ElseIf 2 nd condition Then
      • statement if the 2nd condition is true
      • Else
      • statement if ALL conditions are false
      • End If
    • Select Case Structure
      • useful when you want to check a variable or an expression against multiple possible values
    • Syntax for “ Select Case ”
      • Select Case expression or variable
      • Case range, constant, or variable
      • ‘ Statements
      • Case range, constant, or variable
      • ‘ Statements
      • Case range, constant, or variable
      • ‘ Statements
      • Case Else
      • ‘ Statements
      • End Select
      • Select Case lboColor.Text
      • Case “red”, “purple”, “orange”
      • lblRemark.Text = “This is a warm color.”
      • Case “blue”, “green”, “blue violet”
      • lblRemark.Text = “This is a cool color.”
      • Case Else
      • lblRemark.Text = “Please select a color.”
      • End Case
      • Select Case Val(T xtAge .Text)
      • Case 1 To 3
      • lblRemark .Text = "toddlerhood"
      • Case 4 To 8
      • lblRemark .Text = "childhood"
      • Case 9 To 12
      • lblRemark .Text = "preadolescence"
      • Case 13 To 18
      • lblRemark .Text = "adolescence"
      • Case 19 To 24
      • lblRemark .Text = "young adulthood"
      • Case Is > 24
      • lblRemark .Text = "adulthood"
      • Case Else
      • lblRemark .Text = "infancy"
      • End Select