CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    England
    Posts
    17

    Question Another easy one...

    I have 7 if statements nested inside each other, each one represents a condition. Is there an easy way I can tidy this up and still know which condition caused the error?

    My code is a nightmare to read!

  2. #2
    Join Date
    Nov 2002
    Posts
    13
    I'm a newb programmer...but can't you use a Case ?

  3. #3
    Join Date
    Oct 2002
    Location
    Växjö, Sweden
    Posts
    225
    And to be on the safe side we might show how "a Case" works.

    Here's an example with a combobox:

    Code:
    Select Case ComboBox1.SelectedIndex
        Case 0
            'code
        Case 1
            'code
        Case 2
            'code
        Case Else
            'code
    End Select
    /Leyan

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

Featured