Results 1 to 10 of 10

Thread: select case

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    downey, ca, usa
    Posts
    3

    Post

    translate code into the equivalent select case statement and why!
    if num1=3 then
    num2=5
    elseif num1=10 then
    num2=6
    elseif num1>=15 and num1 <=20 then
    num2=8
    elseif num1>25 then
    num2 =10
    else num2=30
    end if

  2. #2
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    What exactly is your question? What do you need help with?

    ------------------
    Ryan
    corneslen@hotmail.com
    ICQ# 47799046

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    Rod Sa is doing his/her homework!!!!!!!!!!

    ------------------
    Visual Basic Programmer (at least I want to be one)
    ------------------
    PolComSoft
    You will hear a lot about it.


  4. #4
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    That's what I kinda figured. But, hey, why not help him out. That's what this forum is all about, right? Helping other people learn Visual Basic.

    ------------------
    Ryan
    corneslen@hotmail.com
    ICQ# 47799046


    [This message has been edited by Gimpster (edited 11-08-1999).]

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    Code:
    Select Case True
        Case num1 = 3
            num2 = 5
        Case num1 = 10
            num2 = 6
        Case num1 >= 15 And num1 <= 20
            num2 = 8
        Case num1 > 25
            num2 = 10
        Case Else
            num2 = 30
    End Select
    Because it's clearer and easier to maintain.


    ------------------
    Marty

    [This message has been edited by MartinLiss (edited 11-08-1999).]

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    downey, ca, usa
    Posts
    3

    Post

    Hey guys/gals, I need help with this stuff. Apparently I didn't learn it in class!

    Thanx

  7. #7
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    But don't just ask us to do your homework. Use VB help if you have VB, use your books, that's kind of what I'm doing

    ------------------
    Visual Basic Programmer (at least I want to be one)
    ------------------
    PolComSoft
    You will hear a lot about it.


  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    I have no problem at all with someone asking an occasional homework question in this forum. The people who bug me are those who can't be bothered to use Help and instead ask question after question. I also don't really know why it is, but these same people (who seem to be native-english speakers) usually can't spell or construct a proper sentence!

    ------------------
    Marty

    [This message has been edited by MartinLiss (edited 11-08-1999).]

  9. #9
    Hyperactive Member
    Join Date
    Sep 1999
    Posts
    305

    Post

    Another thing that bothers me is when they post something without doing ANY research at all. Usually that question has already been addressed somewhere else on the forum and they are too lazy to find it and don't care about wasting other people's time.

  10. #10
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    What bothers me is when people use the forum to complain about other peo...
    oh never mind!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width