Select Case and With - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Select Case and With

Description:

Do they rake your ache? Do they sow your toe? Conditionals. Visual Basic has an alternative, but ... Exactly what is this 'select case,' Tiffani? Is it really ... – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 23
Provided by: lanceco2
Category:
Tags: case | rake | select

less

Transcript and Presenter's Notes

Title: Select Case and With


1
Select Case and With
  • Molloy College
  • Visual Basic
  • Dr. Cohen

2
Conditionals
  • IfThen ElseElseif

3
Conditionals
  • IfThen ElseElseif
  • Are you bothered by Conditionals?
  • Do they strain your brain?
  • Do they rake your ache?
  • Do they sow your toe?

4
Conditionals
  • Visual Basic has an alternative, but

5
Conditionals
  • Visual Basic has an alternative, but
  • Its not in your book!

6
Conditionals
  • The Math Majors say,
  • What is this new method?

7
Jumpin Geometry?
Agile Algebra?
Corpulent Calculus?
8
Sorry, guys! Those answers are wrong!
9
Select Case
  • Exactly what is this select case,
  • Tiffani?
  • Is it really of any value, Mary?
  • Will it help us or hurt us, Jonathan?

10
Select Case
  • Lets say Dr. Cohen has a quiz to return. He
    looks at the first quiz and sees the name Leon.
    Then he looks around the room. First he sees
    Takako. Then he sees Lianne. Then he sees
    Francyne. Finally he connects the name on the
    quiz Leon with the person in the corner Leon.
    Match!

11
Select Case
  • If the name on the quiz Leon Then
  • give the quiz to Leon.
  • Elseif the name on the quiz Kevin Then dont
    bother.
  • Im so confused I may never give another quiz!

12
Select Case
  • Select Case strName
  • Start by identifying a variable.

13
Select Case
  • Select Case strName
  • Case Leon lblName.caption Leon
  • Case Christy lblName.caption Christy
  • Case Kristy lblName.caption Kristy
  • Case Else
  • Burn leftover quizzes.

14
Select Case
  • Select Case strName
  • Case Leon lblName.caption Leon
  • Case Christy lblName.caption Christy
  • Case Kristy lblName.caption Kristy
  • Case Else
  • Burn leftover quizzes.
  • End Select

15
Select Case
  • Always end your select case with Else to handle
    wayward data thrown into your application by
    subversive members of the Al Banshee terrorist
    group.

16
Select Case
  • Case Is gt 20
  • Case 15
  • Case Lianne
  • Case 1 to 10
  • Case A to J
  • Youll need the keyword IS to represent greater
    and lesser.

17
So which will it be, Math Majors? Else if or
Case? Im thinkingIm thinking!
18
With
19
Are you with me?
  • Assign properties at runtime
  • lblKristen.forecolor vbRed
  • lblKristen.backcolorvbBlue
  • lblKristen.fontsize 96

20
or
21
Are you running with me?
  • With lblKristen
  • .forecolor vbRed
  • .backcolorvbBlue
  • .fontsize 96
  • End With

22
Now listen up! If you know whats good for
yourself, youll follow Dr. Cohen here and learn
all this Visual Basic stuff.
Course Ill never use this stuff, but I dont
need to. You do!
Write a Comment
User Comments (0)
About PowerShow.com