Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

program using Select Case

ammwebammweb Posts: 1Member
I am trying to write a program that will allow input of name and number of pieces(depending on how many enter, which is where the Select Case is used) will display a total amount earned. It has a calculate button and a summary button to display the total number of piece and the total amount earned.

I am confused on how to use the Select Case. Any help would be greatly appreciated.

Comments

  • DrMartenDrMarten Posts: 748Member
    [b][red]This message was edited by DrMarten at 2007-2-4 7:51:0[/red][/b][hr]

    : I am trying to write a program that will allow input of name and number of pieces(depending on how many enter, which is where the Select Case is used) will display a total amount earned. It has a calculate button and a summary button to display the total number of piece and the total amount earned.
    :
    : I am confused on how to use the Select Case. Any help would be greatly appreciated.

    _____________________________________________________________________

    Hi,

    See this page. >>
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmselectcase.asp

    You can also use a less than or a greater than>>

    [code]
    Dim number As Double
    Select number[b][red]
    Case Is < 5[/red][/b]
    'Number is less than 5.
    Case 6
    'Number is 6.
    Case 7,8
    'Number is between 7 and 8 inclusive.
    Case < 15
    'Number is less than 15. [b][blue] I've not tried a trace on this but
    'the [red][b]red[/b][/red] section above may run as well as this section
    ' section where Case Is < 15
    'if the number is < 15.[/blue][/b]
    Case Is > 20
    'Number is greater than 20.
    Case Else
    'Number is [b]NOTHING ( not zero ), means it has not been
    ' assigned a value.[red]This section will be executed
    'as i've not given number a value.[/red][/b]
    End Select
    [/code]

    Regards,

    Dr M.

    P.S. See also the VB.Net Microsoft forum area.>>
    http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=10&SiteID=1

Sign In or Register to comment.