I can't be this dumb surely

Discussion in 'Questions (Windows Mobile)' started by Ianmac, Jul 10, 2007.

  1. Ianmac

    Ianmac Member Licensed User

    OK, I am new to Basic4ppc, but I can make this work in other languages.

    Select ComboBox18.SelectedIndex
    Case 0,1,7 RiskVal=RiskVal + 1
    Case 2,3,5,6 RiskVal=RiskVal + 2
    Case 4 RiskVal=RiskVal + 5
    Case else RiskVal=RiskVal + 0
    End Select

    I know I can use ComboBox.SelecttedIndex to update RiskVal as in

    RiskVal=RiskVal + ComboBox3.SelectedIndex + 1

    which works just fine, so what part of the syntax of the Case statement is illuding me, it just returns a 0 value.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should write:
    Select ComboBox18.SelectedIndex
    Case 0,1,7
    RiskVal=RiskVal + 1
    Case 2,3,5,6
    RiskVal=RiskVal + 2
    Case 4
    RiskVal=RiskVal + 5
    Case else
    RiskVal=RiskVal + 0
    End Select
     
  3. Ianmac

    Ianmac Member Licensed User

    Doh!

    Many thanks, I knew it had to be a simple syntax error but I hadn't tried that one.
    I will bear it in mind in the future.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice